From ffa1ffa659dea2fa9dae6ff955a3a5df2a32c3f8 Mon Sep 17 00:00:00 2001 From: Pavel Punegov <32519625+PavelPunegov@users.noreply.github.com> Date: Thu, 9 Nov 2017 20:27:53 +0300 Subject: [PATCH] Update box tests to 1.2.0-rc-39 --- backend.native/tests/build.gradle | 2 +- .../argumentOrderInObjectSuperCall.kt | 10 + .../argumentOrder/argumentOrderInSuperCall.kt | 11 + .../varargAndDefaultParameters_ForNative.kt | 54 + .../arrays/nonLocalReturnArrayConstructor.kt | 1 + .../codegen/box/arrays/primitiveArrays.kt | 5 +- .../boxingOptimization/boxedIntegersCmp.kt | 46 + .../boxedPrimitivesAreEqual.kt | 21 + .../box/boxingOptimization/boxedRealsCmp.kt | 82 + .../box/boxingOptimization/intCompareTo.kt | 8 + .../box/boxingOptimization/kClassEquals.kt | 20 + .../codegen/box/boxingOptimization/kt17748.kt | 17 + .../codegen/box/boxingOptimization/kt19767.kt | 21 + .../box/boxingOptimization/kt19767_2.kt | 6 + .../box/boxingOptimization/kt19767_3.kt | 34 + .../box/boxingOptimization/kt19767_chain.kt | 23 + .../box/boxingOptimization/maxMinBy.kt | 20 + .../box/callableReference/bound/emptyLHS.kt | 57 + .../bound/equals/propertyAccessors.kt | 3 +- .../bound/equals/reflectionReference.kt | 2 +- .../bound/localUnitFunction.kt | 9 + .../innerClassConstructorWithTwoReceivers.kt | 20 + .../codegen/box/casts/isNullablePrimitive.kt | 48 + .../codegen/box/casts/lambdaToUnitCast.kt | 3 - .../external/codegen/box/casts/unitAsAny.kt | 3 - .../codegen/box/casts/unitAsSafeAny.kt | 3 - .../box/checkcastOptimization/kt19128.kt | 26 + .../box/checkcastOptimization/kt19246.kt | 19 + .../comanionObjectFieldVsClassField.kt | 15 + .../external/codegen/box/classes/kt508.kt | 4 - .../codegen/box/classes/quotedClassName.kt | 9 + .../external/codegen/box/constants/kt9532.kt | 10 +- .../codegen/box/constants/kt9532_lv10.kt | 34 + .../breakInConstructorArguments.kt | 39 + .../continueInConstructorArguments.kt | 40 + .../earlyReturnInConstructorArguments.kt | 41 + ...lineFunInConstructorCallEvaluationOrder.kt | 40 + ...onstructorCallWithDisabledNormalization.kt | 41 + ...ConstructorCallWithEnabledNormalization.kt | 41 + ...nConstructorCallWithStrictNormalization.kt | 41 + .../inlineFunInInnerClassConstructorCall.kt | 43 + .../inlineFunInLocalClassConstructorCall.kt | 41 + ...orCallWithJumpOutInConstructorArguments.kt | 36 + .../nonLocalReturnInConstructorArguments.kt | 43 + ...ssiblyPoppedUnitializedValueInArguments.kt | 36 + .../regularConstructorCallEvaluationOrder.kt | 32 + ...ryCatchInConstructorCallEvaluationOrder.kt | 35 + .../parameterWithNameForFunctionType.kt | 8 + .../tryCatchAfterWhileTrue.kt | 18 + .../box/coroutines/asyncIteratorNullMerge.kt | 136 ++ .../box/coroutines/controlFlow/forWithStep.kt | 35 + .../box/coroutines/coroutineToString.kt | 33 + .../breakWithNonEmptyStack.kt | 40 + .../box/coroutines/inlineFunInGenericClass.kt | 31 + .../inlineGenericFunCalledFromSubclass.kt | 39 + .../box/coroutines/longRangeInSuspendCall.kt | 31 + .../box/coroutines/longRangeInSuspendFun.kt | 26 + .../multiModule/inlineMultiModule.kt | 69 + .../multiModule/inlineMultiModuleOverride.kt | 80 + .../inlineMultiModuleWithController.kt | 77 + .../openFunWithJava.kt | 60 + .../suspendFunctionAsCoroutine/superCall.kt | 34 + .../superCallAbstractClass.kt | 41 + .../superCallInterface.kt | 38 + ...ddleOfObjectConstructionEvaluationOrder.kt | 56 + ...heMiddleOfObjectConstructionWithJumpOut.kt | 152 ++ .../unitTypeReturn/suspendNonLocalReturn.kt | 1 - .../box/coroutines/varSpilling/kt19475.kt | 32 + .../codegen/box/dataClasses/copy/kt12708.kt | 2 + .../box/defaultArguments/implementedByFake.kt | 4 +- ...ritedFromInterfaceViaAbstractSuperclass.kt | 17 + .../genericDelegateUncheckedCast1.kt | 38 + .../genericDelegateUncheckedCast2.kt | 38 + .../genericSetValueViaSyntheticAccessor.kt | 25 + .../box/delegatedProperty/local/kt16864.kt | 13 + .../box/delegatedProperty/local/kt19690.kt | 17 + .../privateSetterKPropertyIsNotMutable.kt | 5 +- .../provideDelegate/generic.kt | 6 +- .../provideDelegate/kt18902.kt | 22 + .../box/delegation/withDefaultParameters.kt | 60 + .../enum/deepInnerClassInEnumEntryClass.kt | 24 + .../enum/deepInnerClassInEnumEntryClass2.kt | 23 + ...ntryReferenceFromInnerClassConstructor1.kt | 24 + ...ntryReferenceFromInnerClassConstructor2.kt | 24 + ...ntryReferenceFromInnerClassConstructor3.kt | 23 + .../box/enum/innerClassInEnumEntryClass.kt | 20 + .../enum/innerClassMethodInEnumEntryClass.kt | 19 + .../enum/innerClassMethodInEnumEntryClass2.kt | 19 + .../external/codegen/box/enum/kt20651.kt | 14 + .../codegen/box/enum/kt20651_inlineLambda.kt | 14 + .../external/codegen/box/enum/kt20651a.kt | 8 + .../external/codegen/box/enum/kt20651b.kt | 17 + .../tests/external/codegen/box/enum/kt7257.kt | 10 + .../codegen/box/enum/kt7257_anonObjectInit.kt | 17 + .../box/enum/kt7257_anonObjectMethod.kt | 16 + .../box/enum/kt7257_boundReference1.kt | 21 + .../box/enum/kt7257_boundReference2.kt | 18 + ...7257_boundReferenceWithImplicitReceiver.kt | 15 + .../box/enum/kt7257_explicitReceiver.kt | 11 + .../box/enum/kt7257_fullyQualifiedReceiver.kt | 11 + .../codegen/box/enum/kt7257_namedLocalFun.kt | 17 + .../codegen/box/enum/kt7257_notInline.kt | 13 + .../external/codegen/box/fullJdk/classpath.kt | 18 - .../box/functions/functionNtoString.kt | 12 +- .../functions/functionNtoStringNoReflect.kt | 12 +- ...bilityAssertionOnExtensionReceiver_lv12.kt | 28 + .../inFunctionWithExpressionBody.kt | 29 + ...nctionWithExpressionBodyWithJavaGeneric.kt | 34 + .../inLocalFunctionWithExpressionBody.kt | 28 + .../inLocalVariableInitializer.kt | 31 + .../inMemberPropertyInitializer.kt | 31 + .../inPropertyGetterWithExpressionBody.kt | 29 + .../inTopLevelPropertyInitializer.kt | 31 + ...ExtensionReceiverInPrivateOperator_lv11.kt | 17 + ...ExtensionReceiverInPrivateOperator_lv12.kt | 21 + ...bilityAssertionOnExtensionReceiver_lv11.kt | 21 + ...bilityAssertionOnExtensionReceiver_lv12.kt | 21 + ...bilityAssertionOnExtensionReceiver_lv11.kt | 17 + ...bilityAssertionOnExtensionReceiver_lv12.kt | 17 + ...ertionOnInlineFunExtensionReceiver_lv11.kt | 17 + ...ertionOnInlineFunExtensionReceiver_lv12.kt | 19 + ...AssertionOnMemberExtensionReceiver_lv12.kt | 20 + ...onOnPrivateMemberExtensionReceiver_lv12.kt | 22 + .../box/jvmPackageName/metadataField.kt | 28 + .../codegen/box/jvmPackageName/rootPackage.kt | 18 + .../codegen/box/jvmPackageName/simple.kt | 21 + .../codegen/box/jvmPackageName/withJvmName.kt | 19 + .../localClasses/closureOfInnerLocalClass.kt | 2 +- .../closureWithSelfInstantiation.kt | 2 +- .../codegen/box/localClasses/kt2873.kt | 2 +- .../trivialInstanceOf.kt | 17 + .../codegen/box/objects/classCompanion.kt | 19 + .../codegen/box/objects/interfaceCompanion.kt | 19 + .../interfaceCompanionObjectReference.kt | 37 + .../external/codegen/box/objects/kt18982.kt | 9 + .../external/codegen/box/objects/object.kt | 15 + ...InAnonymousObjectInSuperConstructorCall.kt | 17 + ...onObjectInInlineLambdaInConstructorBody.kt | 9 + ...ectInInlineLambdaInSuperConstructorCall.kt | 9 + ...ionObjectInLambdaInSuperConstructorCall.kt | 9 + ...InAnonymousObjectInSuperConstructorCall.kt | 17 + ...onObjectInInlineLambdaInConstructorBody.kt | 9 + ...ectInInlineLambdaInSuperConstructorCall.kt | 9 + ...ionObjectInLambdaInSuperConstructorCall.kt | 9 + ...InAnonymousObjectInSuperConstructorCall.kt | 15 + ...ToObjectInInlineLambdaInConstructorBody.kt | 7 + ...ectInInlineLambdaInSuperConstructorCall.kt | 7 + ...eToObjectInLambdaInSuperConstructorCall.kt | 7 + .../operatorConventions/compareTo/boolean.kt | 3 - .../box/operatorConventions/kt20387.kt | 17 + .../primitives/equalsNull_lv11.kt | 39 + .../primitives/equalsNull_lv12.kt | 39 + .../primitives/equalsNull_withExplicitFlag.kt | 40 + .../codegen/box/primitiveTypes/conversions.kt | 56 + .../boxedEqPrimitiveEvaluationOrder.kt | 39 + .../equalityWithObject/boxedLongEqualsLong.kt | 6 + .../generated/boxedEqPrimitiveBoolean.kt | 47 + .../generated/boxedEqPrimitiveByte.kt | 47 + .../generated/boxedEqPrimitiveChar.kt | 47 + .../generated/boxedEqPrimitiveInt.kt | 47 + .../generated/boxedEqPrimitiveLong.kt | 47 + .../generated/boxedEqPrimitiveShort.kt | 47 + .../generated/primitiveEqBoxedBoolean.kt | 47 + .../generated/primitiveEqBoxedByte.kt | 47 + .../generated/primitiveEqBoxedChar.kt | 47 + .../generated/primitiveEqBoxedInt.kt | 47 + .../generated/primitiveEqBoxedLong.kt | 47 + .../generated/primitiveEqBoxedShort.kt | 47 + .../generated/primitiveEqObjectBoolean.kt | 47 + .../generated/primitiveEqObjectByte.kt | 47 + .../generated/primitiveEqObjectChar.kt | 47 + .../generated/primitiveEqObjectInt.kt | 47 + .../generated/primitiveEqObjectLong.kt | 47 + .../generated/primitiveEqObjectShort.kt | 47 + .../objectWithAsymmetricEqualsEqPrimitive.kt | 20 + .../equalityWithObject/whenNullableBoxed.kt | 62 + .../augmentedAssignmentsAndIncrements.kt | 2 +- .../external/codegen/box/properties/kt4383.kt | 3 - .../properties/lateinit/accessorException.kt | 3 - .../box/properties/lateinit/exceptionField.kt | 3 - .../properties/lateinit/exceptionGetter.kt | 3 - .../isInitializedAndDeinitialize/emptyLhs.kt | 39 + .../innerSubclass.kt | 35 + .../propertyImportedFromObject.kt | 16 + .../sideEffects.kt | 21 + .../simpleIsInitialized.kt | 36 + .../topLevelProperty.kt | 12 + .../lateinit/local/capturedLocalLateinit.kt | 11 + .../lateinit/local/localLateinit.kt | 9 + .../uninitializedCapturedMemberAccess.kt | 24 + .../local/uninitializedCapturedRead.kt | 24 + .../local/uninitializedMemberAccess.kt | 20 + .../lateinit/local/uninitializedRead.kt | 20 + .../properties/lateinit/overrideException.kt | 3 - .../lateinit/privateSetterViaSubclass.kt | 16 + .../lateinit/topLevel/accessorException.kt | 28 + .../topLevel/accessorForTopLevelLateinit.kt | 15 + .../lateinit/topLevel/topLevelLateinit.kt | 10 + .../topLevel/uninitializedMemberAccess.kt | 21 + .../lateinit/topLevel/uninitializedRead.kt | 21 + .../box/properties/lateinit/visibility.kt | 4 +- .../comparisonWithRangeBoundEliminated.kt | 23 + .../contains/evaluationOrderForCollection.kt | 27 + .../evaluationOrderForComparableRange.kt | 47 + .../contains/evaluationOrderForDownTo.kt | 31 + .../evaluationOrderForRangeLiteral.kt | 31 + .../ranges/contains/generated/arrayIndices.kt | 2071 +++++++++++++++++ .../ranges/contains/generated/charDownTo.kt | 159 ++ .../contains/generated/charRangeLiteral.kt | 159 ++ .../contains/generated/charSequenceIndices.kt | 1059 +++++++++ .../ranges/contains/generated/charUntil.kt | 159 ++ .../contains/generated/collectionIndices.kt | 1059 +++++++++ .../contains/generated/doubleRangeLiteral.kt | 1058 +++++++++ .../contains/generated/floatRangeLiteral.kt | 1058 +++++++++ .../ranges/contains/generated/intDownTo.kt | 43 + .../contains/generated/intRangeLiteral.kt | 1058 +++++++++ .../box/ranges/contains/generated/intUntil.kt | 1058 +++++++++ .../ranges/contains/generated/longDownTo.kt | 43 + .../contains/generated/longRangeLiteral.kt | 1058 +++++++++ .../ranges/contains/generated/longUntil.kt | 1058 +++++++++ .../codegen/box/ranges/contains/inArray.kt | 7 + .../box/ranges/contains/inCharSequence.kt | 9 + .../ranges/contains/inCustomObjectRange.kt | 22 + ...bleRangeLiteralVsComparableRangeLiteral.kt | 22 + .../codegen/box/ranges/contains/inIterable.kt | 9 + .../box/ranges/contains/inNonMatchingRange.kt | 55 + .../ranges/contains/inPrimitiveProgression.kt | 9 + .../box/ranges/contains/inPrimitiveRange.kt | 9 + .../contains/inRangeLiteralComposition.kt | 27 + .../codegen/box/ranges/contains/inUntil.kt | 29 + .../codegen/box/ranges/contains/kt20106.kt | 7 + .../contains/nullableInPrimitiveRange.kt | 14 + .../box/ranges/forInIndices/indexOfLast.kt | 23 + .../forInRangeLiteralWithMixedTypeBounds.kt | 39 + .../ranges/forInRangeToConstWithOverflow.kt | 12 + .../reflection/annotations/openSuspendFun.kt | 28 + .../annotations/privateAnnotation.kt | 14 + .../reflection/call/callPrivateJavaMethod.kt | 2 +- .../call/disallowNullValueForNotNullField.kt | 1 + .../box/reflection/call/privateProperty.kt | 1 + .../box/reflection/call/propertyAccessors.kt | 1 + .../box/reflection/call/protectedMembers.kt | 35 + .../manyArgumentsNoneDefaultConstructor.kt | 99 + .../manyArgumentsNoneDefaultFunction.kt | 100 + .../callBy/privateMemberFunction.kt | 2 +- .../box/reflection/classes/companionObject.kt | 2 +- .../constructors/annotationClass.kt | 1 + .../constructors/primaryConstructor.kt | 2 +- .../reflection/createAnnotation/callByJava.kt | 2 +- .../createAnnotation/callByKotlin.kt | 2 +- .../reflection/createAnnotation/callJava.kt | 2 +- .../reflection/createAnnotation/callKotlin.kt | 2 +- .../enclosing/lambdaInObjectDeclaration.kt | 2 +- .../functions/declaredVsInheritedFunctions.kt | 1 + .../functions/javaClassGetFunctions.kt | 2 +- .../functions/privateMemberFunction.kt | 3 +- .../functions/simpleGetFunctions.kt | 2 +- .../fakeOverrides/javaFieldGetterSetter.kt | 1 + .../mapping/fakeOverrides/javaMethod.kt | 2 +- .../reflection/mapping/inlineReifiedFun.kt | 4 +- .../box/reflection/mapping/openSuspendFun.kt | 22 + .../methodsFromAny/memberExtensionToString.kt | 6 +- .../methodsFromAny/callableReferences.kt | 2 +- .../methodsFromAny/delegatedProperty.kt | 4 +- .../functionParameterNameAndIndex.kt | 1 + .../reflection/parameters/isMarkedNullable.kt | 2 +- .../box/reflection/parameters/kinds.kt | 2 +- .../properties/accessors/accessorNames.kt | 1 + .../properties/accessors/memberExtensions.kt | 1 + .../reflection/properties/allVsDeclared.kt | 2 +- .../callPrivatePropertyFromGetProperties.kt | 5 +- .../declaredVsInheritedProperties.kt | 1 + .../properties/fakeOverridesInSubclass.kt | 6 +- ...nericClassLiteralPropertyReceiverIsStar.kt | 1 + ...getExtensionPropertiesMutableVsReadonly.kt | 3 +- .../getPropertiesMutableVsReadonly.kt | 3 +- .../reflection/properties/invokeKProperty.kt | 2 +- .../kotlinPropertyInheritedInJava.kt | 3 +- .../properties/localDelegated/defaultImpls.kt | 23 + .../properties/localDelegated/inlineFun.kt | 26 + .../localDelegated/localDelegatedProperty.kt | 75 + .../localDelegated/multiFileClass.kt | 43 + .../localDelegated/variableOfGenericType.kt | 31 + .../memberAndMemberExtensionWithSameName.kt | 5 +- .../reflection/properties/privateClassVal.kt | 3 +- .../reflection/properties/privateClassVar.kt | 3 +- .../privateFakeOverrideFromSuperclass.kt | 2 +- ...vatePropertyCallIsAccessibleOnAccessors.kt | 1 + .../properties/privateToThisAccessors.kt | 1 + .../properties/protectedClassVar.kt | 3 +- .../properties/simpleGetProperties.kt | 6 +- .../supertypes/builtInClassSupertypes.kt | 2 +- .../reflection/supertypes/simpleSupertypes.kt | 19 + .../approximateIntersectionType.kt | 30 + .../dontCaptureTypesWithTypeVariables.kt | 14 + .../functionLiteralAsLastExpressionInBlock.kt | 8 + .../regressions/intersectionAsLastLambda.kt | 23 + .../regressions/intersectionOfEqualTypes.kt | 18 + .../codegen/box/regressions/kt18779.kt | 19 + .../lambdaAsLastExpressionInLambda.kt | 5 + .../regressions/lambdaPostponeConstruction.kt | 14 + .../box/regressions/lambdaWrongReturnType.kt | 7 + .../noCapturingForTypesWithTypeVariables.kt | 10 + .../box/regressions/noResolutionRecursion.kt | 5 + .../nullabilityForCommonCapturedSupertypes.kt | 14 + .../box/regressions/nullableAfterExclExcl.kt | 13 + .../box/regressions/objectInsideDelegation.kt | 23 + .../regressions/resolvedCallForGetOperator.kt | 8 + .../codegen/box/regressions/supertypeDepth.kt | 18 + .../box/reified/expectedTypeFromCast.kt | 19 + .../box/safeCall/primitiveEqSafeCall.kt | 56 + .../box/safeCall/primitiveNotEqSafeCall.kt | 43 + .../box/safeCall/safeCallEqPrimitive.kt | 55 + .../box/safeCall/safeCallNotEqPrimitive.kt | 43 + .../codegen/box/sam/constructors/kt19251.kt | 14 + .../box/sam/constructors/kt19251_child.kt | 17 + .../withNonLocalReturn.kt | 3 - .../defaultAndNamedCombination.kt | 37 + .../signatureAnnotations/defaultBoxTypes.kt | 80 + .../signatureAnnotations/defaultEnumType.kt | 42 + .../defaultLongLiteral.kt | 48 + .../defaultMultipleParams.kt | 43 + .../box/signatureAnnotations/defaultNull.kt | 56 + .../defaultNullableBoxTypes.kt | 81 + .../signatureAnnotations/defaultOverrides.kt | 38 + .../defaultPrimitiveTypes.kt | 88 + .../defaultValueInConstructor.kt | 40 + .../defaultWithJavaBase.kt | 26 + .../defaultWithKotlinBase.kt | 23 + .../reorderedParameterNames.kt | 31 + .../codegen/box/smartCasts/kt17725.kt | 10 + .../codegen/box/smartCasts/kt19058.kt | 19 + .../codegen/box/smartCasts/kt19100.kt | 12 + .../box/specialBuiltins/removeSetInt.kt | 18 + .../box/strings/constInStringTemplate.kt | 25 + .../external/codegen/box/strings/kt894.kt | 3 - .../codegen/box/strings/nestedConcat.kt | 21 + .../super/superConstructor/kt17464_arrayOf.kt | 5 + .../superConstructor/kt17464_linkedMapOf.kt | 9 + .../box/super/superConstructor/kt18356.kt | 8 + .../box/super/superConstructor/kt18356_2.kt | 8 + .../superConstructor/objectExtendsInner.kt | 14 + .../objectExtendsLocalInner.kt | 17 + .../accessorForGenericConstructor.kt | 20 + .../accessorForGenericMethod.kt | 29 + .../accessorForGenericMethodWithDefaults.kt | 29 + .../syntheticAccessors/jvmNameForAccessors.kt | 15 + .../interfaceWithNonAbstractFunIndirect.kt | 29 + ...erfaceWithNonAbstractFunIndirectGeneric.kt | 27 + .../external/codegen/box/traits/kt3500.kt | 3 - .../external/codegen/box/unit/UnitValue.kt | 3 - .../tests/external/codegen/box/unit/kt4212.kt | 3 - .../assigningArrayToVarargInAnnotation.kt | 68 + .../doNotCopyImmediatelyCreatedArrays.kt | 102 + .../when/whenSafeCallSubjectEvaluatedOnce.kt | 19 + .../boxInline/anonymousObject/kt17972.kt | 33 + .../boxInline/anonymousObject/kt17972_2.kt | 33 + .../boxInline/anonymousObject/kt17972_3.kt | 35 + .../boxInline/anonymousObject/kt17972_4.kt | 37 + .../boxInline/anonymousObject/kt17972_5.kt | 35 + .../anonymousObject/kt17972_super.kt | 35 + .../anonymousObject/kt17972_super2.kt | 37 + .../anonymousObject/kt17972_super3.kt | 39 + .../boxInline/anonymousObject/kt19434.kt | 23 + .../boxInline/anonymousObject/kt19434_2.kt | 24 + .../boxInline/anonymousObject/kt19723.kt | 21 + .../apiVersionAtLeast1.kt | 41 + .../callableReference/bound/kt18728.kt | 16 + .../callableReference/bound/kt18728_2.kt | 16 + .../callableReference/bound/kt18728_3.kt | 19 + .../callableReference/bound/kt18728_4.kt | 18 + .../callableReference/bound/mixed.kt | 23 + .../boxInline/defaultValues/33Parameters.kt | 53 + .../33ParametersInConstructor.kt | 51 + .../inlineLambdaInNoInlineDefault.kt | 16 + .../boxInline/defaultValues/kt18689.kt | 21 + .../boxInline/defaultValues/kt18689_2.kt | 21 + .../boxInline/defaultValues/kt18689_3.kt | 21 + .../boxInline/defaultValues/kt18689_4.kt | 21 + .../boundFunctionReference.kt | 20 + .../boundFunctionReferenceOnInt.kt | 17 + .../boundFunctionReferenceOnLong.kt | 17 + .../boundPropertyReference.kt | 18 + .../boundPropertyReferenceOnInt.kt | 21 + .../boundPropertyReferenceOnLong.kt | 21 + .../callableReferences/constuctorReference.kt | 20 + .../functionImportedFromObject.kt | 24 + .../functionReference.kt | 2 +- .../functionReferenceFromClass.kt | 5 +- .../functionReferenceFromObject.kt | 22 + .../innerClassConstuctorReference.kt | 23 + .../privateFunctionReference.kt | 18 + .../privatePropertyReference.kt | 18 + .../propertyImportedFromObject.kt | 21 + .../callableReferences/propertyReference.kt | 18 + .../propertyReferenceFromClass.kt | 18 + .../propertyReferenceFromObject.kt | 20 + .../lambdaInlining/defaultLambdaInNoInline.kt | 3 +- .../lambdaInlining/instanceCapuredInClass.kt | 3 +- .../instanceCapuredInInterface.kt | 3 +- .../lambdaInlining/jvmStaticDefault.kt | 4 +- .../defaultValues/lambdaInlining/noInline.kt | 2 + .../nonDefaultInlineInNoInline.kt | 3 +- .../lambdaInlining/receiverClash.kt | 21 + .../lambdaInlining/receiverClash2.kt | 22 + .../lambdaInlining/receiverClashInClass.kt | 24 + .../lambdaInlining/receiverClashInClass2.kt | 26 + .../defaultValues/lambdaInlining/simple.kt | 3 +- .../lambdaInlining/simpleErased.kt | 3 +- .../simpleErasedStaticInstance.kt | 3 +- .../lambdaInlining/simpleExtension.kt | 17 + .../lambdaInlining/simpleGeneric.kt | 3 +- .../lambdaInlining/simpleStaticInstance.kt | 3 +- .../defaultValues/lambdaInlining/thisClash.kt | 23 + .../lambdaInlining/thisClashInClass.kt | 25 + .../defaultValues/maskElimination/kt18792.kt | 21 + .../defaultValues/maskElimination/kt19679.kt | 19 + .../maskElimination/kt19679_2.kt | 15 + .../maskElimination/kt19679_3.kt | 20 + .../boxInline/defaultValues/varArgNoInline.kt | 20 + .../boxInline/delegatedProperty/kt16864.kt | 23 + .../localInAnonymousObject.kt | 26 + .../delegatedProperty/localInLambda.kt | 23 + .../boxInline/jvmPackageName/simple.kt | 21 + .../boxInline/reified/defaultLambda/chain.kt | 26 + .../boxInline/reified/defaultLambda/nested.kt | 19 + .../reified/defaultLambda/nested2.kt | 21 + .../reified/defaultLambda/nested2Static.kt | 21 + .../reified/defaultLambda/nestedStatic.kt | 19 + .../boxInline/reified/defaultLambda/simple.kt | 19 + .../reified/defaultLambda/transitiveChain.kt | 23 + .../defaultLambda/transitiveChainStatic.kt | 26 + .../boxInline/smap/anonymous/kt19175.kt | 79 + .../codegen/boxInline/smap/defaultFunction.kt | 41 + .../boxInline/smap/defaultLambda/nested.kt | 91 + .../boxInline/smap/defaultLambda/simple.kt | 64 + .../jvmPackageName.kt | 26 + .../jvmPackageNameInRootPackage.kt | 19 + .../jvmPackageNameWithJvmName.kt | 23 + .../multifileClassWithTypealias.kt | 16 + .../targetedJvmName.kt | 15 + gradle.properties | 4 +- 442 files changed, 20811 insertions(+), 165 deletions(-) create mode 100644 backend.native/tests/external/codegen/box/argumentOrder/argumentOrderInObjectSuperCall.kt create mode 100644 backend.native/tests/external/codegen/box/argumentOrder/argumentOrderInSuperCall.kt create mode 100644 backend.native/tests/external/codegen/box/argumentOrder/varargAndDefaultParameters_ForNative.kt create mode 100644 backend.native/tests/external/codegen/box/boxingOptimization/boxedIntegersCmp.kt create mode 100644 backend.native/tests/external/codegen/box/boxingOptimization/boxedPrimitivesAreEqual.kt create mode 100644 backend.native/tests/external/codegen/box/boxingOptimization/boxedRealsCmp.kt create mode 100644 backend.native/tests/external/codegen/box/boxingOptimization/intCompareTo.kt create mode 100644 backend.native/tests/external/codegen/box/boxingOptimization/kClassEquals.kt create mode 100644 backend.native/tests/external/codegen/box/boxingOptimization/kt17748.kt create mode 100644 backend.native/tests/external/codegen/box/boxingOptimization/kt19767.kt create mode 100644 backend.native/tests/external/codegen/box/boxingOptimization/kt19767_2.kt create mode 100644 backend.native/tests/external/codegen/box/boxingOptimization/kt19767_3.kt create mode 100644 backend.native/tests/external/codegen/box/boxingOptimization/kt19767_chain.kt create mode 100644 backend.native/tests/external/codegen/box/boxingOptimization/maxMinBy.kt create mode 100644 backend.native/tests/external/codegen/box/callableReference/bound/emptyLHS.kt create mode 100644 backend.native/tests/external/codegen/box/callableReference/bound/localUnitFunction.kt create mode 100644 backend.native/tests/external/codegen/box/callableReference/function/innerClassConstructorWithTwoReceivers.kt create mode 100644 backend.native/tests/external/codegen/box/casts/isNullablePrimitive.kt create mode 100644 backend.native/tests/external/codegen/box/checkcastOptimization/kt19128.kt create mode 100644 backend.native/tests/external/codegen/box/checkcastOptimization/kt19246.kt create mode 100644 backend.native/tests/external/codegen/box/classes/comanionObjectFieldVsClassField.kt create mode 100644 backend.native/tests/external/codegen/box/classes/quotedClassName.kt create mode 100644 backend.native/tests/external/codegen/box/constants/kt9532_lv10.kt create mode 100644 backend.native/tests/external/codegen/box/constructorCall/breakInConstructorArguments.kt create mode 100644 backend.native/tests/external/codegen/box/constructorCall/continueInConstructorArguments.kt create mode 100644 backend.native/tests/external/codegen/box/constructorCall/earlyReturnInConstructorArguments.kt create mode 100644 backend.native/tests/external/codegen/box/constructorCall/inlineFunInConstructorCallEvaluationOrder.kt create mode 100644 backend.native/tests/external/codegen/box/constructorCall/inlineFunInConstructorCallWithDisabledNormalization.kt create mode 100644 backend.native/tests/external/codegen/box/constructorCall/inlineFunInConstructorCallWithEnabledNormalization.kt create mode 100644 backend.native/tests/external/codegen/box/constructorCall/inlineFunInConstructorCallWithStrictNormalization.kt create mode 100644 backend.native/tests/external/codegen/box/constructorCall/inlineFunInInnerClassConstructorCall.kt create mode 100644 backend.native/tests/external/codegen/box/constructorCall/inlineFunInLocalClassConstructorCall.kt create mode 100644 backend.native/tests/external/codegen/box/constructorCall/nestedConstructorCallWithJumpOutInConstructorArguments.kt create mode 100644 backend.native/tests/external/codegen/box/constructorCall/nonLocalReturnInConstructorArguments.kt create mode 100644 backend.native/tests/external/codegen/box/constructorCall/possiblyPoppedUnitializedValueInArguments.kt create mode 100644 backend.native/tests/external/codegen/box/constructorCall/regularConstructorCallEvaluationOrder.kt create mode 100644 backend.native/tests/external/codegen/box/constructorCall/tryCatchInConstructorCallEvaluationOrder.kt create mode 100644 backend.native/tests/external/codegen/box/controlStructures/parameterWithNameForFunctionType.kt create mode 100644 backend.native/tests/external/codegen/box/controlStructures/tryCatchInExpressions/tryCatchAfterWhileTrue.kt create mode 100644 backend.native/tests/external/codegen/box/coroutines/asyncIteratorNullMerge.kt create mode 100644 backend.native/tests/external/codegen/box/coroutines/controlFlow/forWithStep.kt create mode 100644 backend.native/tests/external/codegen/box/coroutines/coroutineToString.kt create mode 100644 backend.native/tests/external/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt create mode 100644 backend.native/tests/external/codegen/box/coroutines/inlineFunInGenericClass.kt create mode 100644 backend.native/tests/external/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt create mode 100644 backend.native/tests/external/codegen/box/coroutines/longRangeInSuspendCall.kt create mode 100644 backend.native/tests/external/codegen/box/coroutines/longRangeInSuspendFun.kt create mode 100644 backend.native/tests/external/codegen/box/coroutines/multiModule/inlineMultiModule.kt create mode 100644 backend.native/tests/external/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt create mode 100644 backend.native/tests/external/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt create mode 100644 backend.native/tests/external/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt create mode 100644 backend.native/tests/external/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt create mode 100644 backend.native/tests/external/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt create mode 100644 backend.native/tests/external/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt create mode 100644 backend.native/tests/external/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt create mode 100644 backend.native/tests/external/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt create mode 100644 backend.native/tests/external/codegen/box/coroutines/varSpilling/kt19475.kt create mode 100644 backend.native/tests/external/codegen/box/defaultArguments/inheritedFromInterfaceViaAbstractSuperclass.kt create mode 100644 backend.native/tests/external/codegen/box/delegatedProperty/genericDelegateUncheckedCast1.kt create mode 100644 backend.native/tests/external/codegen/box/delegatedProperty/genericDelegateUncheckedCast2.kt create mode 100644 backend.native/tests/external/codegen/box/delegatedProperty/genericSetValueViaSyntheticAccessor.kt create mode 100644 backend.native/tests/external/codegen/box/delegatedProperty/local/kt16864.kt create mode 100644 backend.native/tests/external/codegen/box/delegatedProperty/local/kt19690.kt create mode 100644 backend.native/tests/external/codegen/box/delegatedProperty/provideDelegate/kt18902.kt create mode 100644 backend.native/tests/external/codegen/box/delegation/withDefaultParameters.kt create mode 100644 backend.native/tests/external/codegen/box/enum/deepInnerClassInEnumEntryClass.kt create mode 100644 backend.native/tests/external/codegen/box/enum/deepInnerClassInEnumEntryClass2.kt create mode 100644 backend.native/tests/external/codegen/box/enum/enumEntryReferenceFromInnerClassConstructor1.kt create mode 100644 backend.native/tests/external/codegen/box/enum/enumEntryReferenceFromInnerClassConstructor2.kt create mode 100644 backend.native/tests/external/codegen/box/enum/enumEntryReferenceFromInnerClassConstructor3.kt create mode 100644 backend.native/tests/external/codegen/box/enum/innerClassInEnumEntryClass.kt create mode 100644 backend.native/tests/external/codegen/box/enum/innerClassMethodInEnumEntryClass.kt create mode 100644 backend.native/tests/external/codegen/box/enum/innerClassMethodInEnumEntryClass2.kt create mode 100644 backend.native/tests/external/codegen/box/enum/kt20651.kt create mode 100644 backend.native/tests/external/codegen/box/enum/kt20651_inlineLambda.kt create mode 100644 backend.native/tests/external/codegen/box/enum/kt20651a.kt create mode 100644 backend.native/tests/external/codegen/box/enum/kt20651b.kt create mode 100644 backend.native/tests/external/codegen/box/enum/kt7257.kt create mode 100644 backend.native/tests/external/codegen/box/enum/kt7257_anonObjectInit.kt create mode 100644 backend.native/tests/external/codegen/box/enum/kt7257_anonObjectMethod.kt create mode 100644 backend.native/tests/external/codegen/box/enum/kt7257_boundReference1.kt create mode 100644 backend.native/tests/external/codegen/box/enum/kt7257_boundReference2.kt create mode 100644 backend.native/tests/external/codegen/box/enum/kt7257_boundReferenceWithImplicitReceiver.kt create mode 100644 backend.native/tests/external/codegen/box/enum/kt7257_explicitReceiver.kt create mode 100644 backend.native/tests/external/codegen/box/enum/kt7257_fullyQualifiedReceiver.kt create mode 100644 backend.native/tests/external/codegen/box/enum/kt7257_namedLocalFun.kt create mode 100644 backend.native/tests/external/codegen/box/enum/kt7257_notInline.kt delete mode 100644 backend.native/tests/external/codegen/box/fullJdk/classpath.kt create mode 100644 backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/destructuringAssignmentWithNullabilityAssertionOnExtensionReceiver_lv12.kt create mode 100644 backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inFunctionWithExpressionBody.kt create mode 100644 backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inFunctionWithExpressionBodyWithJavaGeneric.kt create mode 100644 backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inLocalFunctionWithExpressionBody.kt create mode 100644 backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inLocalVariableInitializer.kt create mode 100644 backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inMemberPropertyInitializer.kt create mode 100644 backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inPropertyGetterWithExpressionBody.kt create mode 100644 backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inTopLevelPropertyInitializer.kt create mode 100644 backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/incWithNullabilityAssertionOnExtensionReceiverInPrivateOperator_lv11.kt create mode 100644 backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/incWithNullabilityAssertionOnExtensionReceiverInPrivateOperator_lv12.kt create mode 100644 backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/incWithNullabilityAssertionOnExtensionReceiver_lv11.kt create mode 100644 backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/incWithNullabilityAssertionOnExtensionReceiver_lv12.kt create mode 100644 backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnExtensionReceiver_lv11.kt create mode 100644 backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnExtensionReceiver_lv12.kt create mode 100644 backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnInlineFunExtensionReceiver_lv11.kt create mode 100644 backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnInlineFunExtensionReceiver_lv12.kt create mode 100644 backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnMemberExtensionReceiver_lv12.kt create mode 100644 backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnPrivateMemberExtensionReceiver_lv12.kt create mode 100644 backend.native/tests/external/codegen/box/jvmPackageName/metadataField.kt create mode 100644 backend.native/tests/external/codegen/box/jvmPackageName/rootPackage.kt create mode 100644 backend.native/tests/external/codegen/box/jvmPackageName/simple.kt create mode 100644 backend.native/tests/external/codegen/box/jvmPackageName/withJvmName.kt create mode 100644 backend.native/tests/external/codegen/box/nullCheckOptimization/trivialInstanceOf.kt create mode 100644 backend.native/tests/external/codegen/box/objects/classCompanion.kt create mode 100644 backend.native/tests/external/codegen/box/objects/interfaceCompanion.kt create mode 100644 backend.native/tests/external/codegen/box/objects/interfaceCompanionObjectReference.kt create mode 100644 backend.native/tests/external/codegen/box/objects/kt18982.kt create mode 100644 backend.native/tests/external/codegen/box/objects/object.kt create mode 100644 backend.native/tests/external/codegen/box/objects/selfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall.kt create mode 100644 backend.native/tests/external/codegen/box/objects/selfReferenceToCompanionObjectInInlineLambdaInConstructorBody.kt create mode 100644 backend.native/tests/external/codegen/box/objects/selfReferenceToCompanionObjectInInlineLambdaInSuperConstructorCall.kt create mode 100644 backend.native/tests/external/codegen/box/objects/selfReferenceToCompanionObjectInLambdaInSuperConstructorCall.kt create mode 100644 backend.native/tests/external/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall.kt create mode 100644 backend.native/tests/external/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInInlineLambdaInConstructorBody.kt create mode 100644 backend.native/tests/external/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInInlineLambdaInSuperConstructorCall.kt create mode 100644 backend.native/tests/external/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInLambdaInSuperConstructorCall.kt create mode 100644 backend.native/tests/external/codegen/box/objects/selfReferenceToObjectInAnonymousObjectInSuperConstructorCall.kt create mode 100644 backend.native/tests/external/codegen/box/objects/selfReferenceToObjectInInlineLambdaInConstructorBody.kt create mode 100644 backend.native/tests/external/codegen/box/objects/selfReferenceToObjectInInlineLambdaInSuperConstructorCall.kt create mode 100644 backend.native/tests/external/codegen/box/objects/selfReferenceToObjectInLambdaInSuperConstructorCall.kt create mode 100644 backend.native/tests/external/codegen/box/operatorConventions/kt20387.kt create mode 100644 backend.native/tests/external/codegen/box/platformTypes/primitives/equalsNull_lv11.kt create mode 100644 backend.native/tests/external/codegen/box/platformTypes/primitives/equalsNull_lv12.kt create mode 100644 backend.native/tests/external/codegen/box/platformTypes/primitives/equalsNull_withExplicitFlag.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/conversions.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/boxedEqPrimitiveEvaluationOrder.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/boxedLongEqualsLong.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveBoolean.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveByte.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveChar.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveInt.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveLong.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveShort.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedBoolean.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedByte.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedChar.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedInt.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedLong.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedShort.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectBoolean.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectByte.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectChar.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectInt.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectLong.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectShort.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/objectWithAsymmetricEqualsEqPrimitive.kt create mode 100644 backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/whenNullableBoxed.kt create mode 100644 backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/emptyLhs.kt create mode 100644 backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/innerSubclass.kt create mode 100644 backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/propertyImportedFromObject.kt create mode 100644 backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/sideEffects.kt create mode 100644 backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/simpleIsInitialized.kt create mode 100644 backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/topLevelProperty.kt create mode 100644 backend.native/tests/external/codegen/box/properties/lateinit/local/capturedLocalLateinit.kt create mode 100644 backend.native/tests/external/codegen/box/properties/lateinit/local/localLateinit.kt create mode 100644 backend.native/tests/external/codegen/box/properties/lateinit/local/uninitializedCapturedMemberAccess.kt create mode 100644 backend.native/tests/external/codegen/box/properties/lateinit/local/uninitializedCapturedRead.kt create mode 100644 backend.native/tests/external/codegen/box/properties/lateinit/local/uninitializedMemberAccess.kt create mode 100644 backend.native/tests/external/codegen/box/properties/lateinit/local/uninitializedRead.kt create mode 100644 backend.native/tests/external/codegen/box/properties/lateinit/privateSetterViaSubclass.kt create mode 100644 backend.native/tests/external/codegen/box/properties/lateinit/topLevel/accessorException.kt create mode 100644 backend.native/tests/external/codegen/box/properties/lateinit/topLevel/accessorForTopLevelLateinit.kt create mode 100644 backend.native/tests/external/codegen/box/properties/lateinit/topLevel/topLevelLateinit.kt create mode 100644 backend.native/tests/external/codegen/box/properties/lateinit/topLevel/uninitializedMemberAccess.kt create mode 100644 backend.native/tests/external/codegen/box/properties/lateinit/topLevel/uninitializedRead.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/comparisonWithRangeBoundEliminated.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/evaluationOrderForCollection.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/evaluationOrderForComparableRange.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/evaluationOrderForDownTo.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/evaluationOrderForRangeLiteral.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/generated/arrayIndices.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/generated/charDownTo.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/generated/charRangeLiteral.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/generated/charSequenceIndices.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/generated/charUntil.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/generated/collectionIndices.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/generated/doubleRangeLiteral.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/generated/floatRangeLiteral.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/generated/intDownTo.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/generated/intRangeLiteral.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/generated/intUntil.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/generated/longDownTo.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/generated/longRangeLiteral.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/generated/longUntil.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/inArray.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/inCharSequence.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/inCustomObjectRange.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/inDoubleRangeLiteralVsComparableRangeLiteral.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/inIterable.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/inNonMatchingRange.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/inPrimitiveProgression.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/inPrimitiveRange.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/inRangeLiteralComposition.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/inUntil.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/kt20106.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/contains/nullableInPrimitiveRange.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/forInIndices/indexOfLast.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/forInRangeLiteralWithMixedTypeBounds.kt create mode 100644 backend.native/tests/external/codegen/box/ranges/forInRangeToConstWithOverflow.kt create mode 100644 backend.native/tests/external/codegen/box/reflection/annotations/openSuspendFun.kt create mode 100644 backend.native/tests/external/codegen/box/reflection/annotations/privateAnnotation.kt create mode 100644 backend.native/tests/external/codegen/box/reflection/call/protectedMembers.kt create mode 100644 backend.native/tests/external/codegen/box/reflection/callBy/manyArgumentsNoneDefaultConstructor.kt create mode 100644 backend.native/tests/external/codegen/box/reflection/callBy/manyArgumentsNoneDefaultFunction.kt create mode 100644 backend.native/tests/external/codegen/box/reflection/mapping/openSuspendFun.kt create mode 100644 backend.native/tests/external/codegen/box/reflection/properties/localDelegated/defaultImpls.kt create mode 100644 backend.native/tests/external/codegen/box/reflection/properties/localDelegated/inlineFun.kt create mode 100644 backend.native/tests/external/codegen/box/reflection/properties/localDelegated/localDelegatedProperty.kt create mode 100644 backend.native/tests/external/codegen/box/reflection/properties/localDelegated/multiFileClass.kt create mode 100644 backend.native/tests/external/codegen/box/reflection/properties/localDelegated/variableOfGenericType.kt create mode 100644 backend.native/tests/external/codegen/box/regressions/approximateIntersectionType.kt create mode 100644 backend.native/tests/external/codegen/box/regressions/dontCaptureTypesWithTypeVariables.kt create mode 100644 backend.native/tests/external/codegen/box/regressions/functionLiteralAsLastExpressionInBlock.kt create mode 100644 backend.native/tests/external/codegen/box/regressions/intersectionAsLastLambda.kt create mode 100644 backend.native/tests/external/codegen/box/regressions/intersectionOfEqualTypes.kt create mode 100644 backend.native/tests/external/codegen/box/regressions/kt18779.kt create mode 100644 backend.native/tests/external/codegen/box/regressions/lambdaAsLastExpressionInLambda.kt create mode 100644 backend.native/tests/external/codegen/box/regressions/lambdaPostponeConstruction.kt create mode 100644 backend.native/tests/external/codegen/box/regressions/lambdaWrongReturnType.kt create mode 100644 backend.native/tests/external/codegen/box/regressions/noCapturingForTypesWithTypeVariables.kt create mode 100644 backend.native/tests/external/codegen/box/regressions/noResolutionRecursion.kt create mode 100644 backend.native/tests/external/codegen/box/regressions/nullabilityForCommonCapturedSupertypes.kt create mode 100644 backend.native/tests/external/codegen/box/regressions/nullableAfterExclExcl.kt create mode 100644 backend.native/tests/external/codegen/box/regressions/objectInsideDelegation.kt create mode 100644 backend.native/tests/external/codegen/box/regressions/resolvedCallForGetOperator.kt create mode 100644 backend.native/tests/external/codegen/box/regressions/supertypeDepth.kt create mode 100644 backend.native/tests/external/codegen/box/reified/expectedTypeFromCast.kt create mode 100644 backend.native/tests/external/codegen/box/safeCall/primitiveEqSafeCall.kt create mode 100644 backend.native/tests/external/codegen/box/safeCall/primitiveNotEqSafeCall.kt create mode 100644 backend.native/tests/external/codegen/box/safeCall/safeCallEqPrimitive.kt create mode 100644 backend.native/tests/external/codegen/box/safeCall/safeCallNotEqPrimitive.kt create mode 100644 backend.native/tests/external/codegen/box/sam/constructors/kt19251.kt create mode 100644 backend.native/tests/external/codegen/box/sam/constructors/kt19251_child.kt create mode 100644 backend.native/tests/external/codegen/box/signatureAnnotations/defaultAndNamedCombination.kt create mode 100644 backend.native/tests/external/codegen/box/signatureAnnotations/defaultBoxTypes.kt create mode 100644 backend.native/tests/external/codegen/box/signatureAnnotations/defaultEnumType.kt create mode 100644 backend.native/tests/external/codegen/box/signatureAnnotations/defaultLongLiteral.kt create mode 100644 backend.native/tests/external/codegen/box/signatureAnnotations/defaultMultipleParams.kt create mode 100644 backend.native/tests/external/codegen/box/signatureAnnotations/defaultNull.kt create mode 100644 backend.native/tests/external/codegen/box/signatureAnnotations/defaultNullableBoxTypes.kt create mode 100644 backend.native/tests/external/codegen/box/signatureAnnotations/defaultOverrides.kt create mode 100644 backend.native/tests/external/codegen/box/signatureAnnotations/defaultPrimitiveTypes.kt create mode 100644 backend.native/tests/external/codegen/box/signatureAnnotations/defaultValueInConstructor.kt create mode 100644 backend.native/tests/external/codegen/box/signatureAnnotations/defaultWithJavaBase.kt create mode 100644 backend.native/tests/external/codegen/box/signatureAnnotations/defaultWithKotlinBase.kt create mode 100644 backend.native/tests/external/codegen/box/signatureAnnotations/reorderedParameterNames.kt create mode 100644 backend.native/tests/external/codegen/box/smartCasts/kt17725.kt create mode 100644 backend.native/tests/external/codegen/box/smartCasts/kt19058.kt create mode 100644 backend.native/tests/external/codegen/box/smartCasts/kt19100.kt create mode 100644 backend.native/tests/external/codegen/box/specialBuiltins/removeSetInt.kt create mode 100644 backend.native/tests/external/codegen/box/strings/constInStringTemplate.kt create mode 100644 backend.native/tests/external/codegen/box/strings/nestedConcat.kt create mode 100644 backend.native/tests/external/codegen/box/super/superConstructor/kt17464_arrayOf.kt create mode 100644 backend.native/tests/external/codegen/box/super/superConstructor/kt17464_linkedMapOf.kt create mode 100644 backend.native/tests/external/codegen/box/super/superConstructor/kt18356.kt create mode 100644 backend.native/tests/external/codegen/box/super/superConstructor/kt18356_2.kt create mode 100644 backend.native/tests/external/codegen/box/super/superConstructor/objectExtendsInner.kt create mode 100644 backend.native/tests/external/codegen/box/super/superConstructor/objectExtendsLocalInner.kt create mode 100644 backend.native/tests/external/codegen/box/syntheticAccessors/accessorForGenericConstructor.kt create mode 100644 backend.native/tests/external/codegen/box/syntheticAccessors/accessorForGenericMethod.kt create mode 100644 backend.native/tests/external/codegen/box/syntheticAccessors/accessorForGenericMethodWithDefaults.kt create mode 100644 backend.native/tests/external/codegen/box/syntheticAccessors/jvmNameForAccessors.kt create mode 100644 backend.native/tests/external/codegen/box/traits/interfaceWithNonAbstractFunIndirect.kt create mode 100644 backend.native/tests/external/codegen/box/traits/interfaceWithNonAbstractFunIndirectGeneric.kt create mode 100644 backend.native/tests/external/codegen/box/vararg/assigningArrayToVarargInAnnotation.kt create mode 100644 backend.native/tests/external/codegen/box/vararg/doNotCopyImmediatelyCreatedArrays.kt create mode 100644 backend.native/tests/external/codegen/box/when/whenSafeCallSubjectEvaluatedOnce.kt create mode 100644 backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972.kt create mode 100644 backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_2.kt create mode 100644 backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_3.kt create mode 100644 backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_4.kt create mode 100644 backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_5.kt create mode 100644 backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_super.kt create mode 100644 backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_super2.kt create mode 100644 backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_super3.kt create mode 100644 backend.native/tests/external/codegen/boxInline/anonymousObject/kt19434.kt create mode 100644 backend.native/tests/external/codegen/boxInline/anonymousObject/kt19434_2.kt create mode 100644 backend.native/tests/external/codegen/boxInline/anonymousObject/kt19723.kt create mode 100644 backend.native/tests/external/codegen/boxInline/bytecodePreprocessing/apiVersionAtLeast1.kt create mode 100644 backend.native/tests/external/codegen/boxInline/callableReference/bound/kt18728.kt create mode 100644 backend.native/tests/external/codegen/boxInline/callableReference/bound/kt18728_2.kt create mode 100644 backend.native/tests/external/codegen/boxInline/callableReference/bound/kt18728_3.kt create mode 100644 backend.native/tests/external/codegen/boxInline/callableReference/bound/kt18728_4.kt create mode 100644 backend.native/tests/external/codegen/boxInline/callableReference/bound/mixed.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/33Parameters.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/33ParametersInConstructor.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/inlineLambdaInNoInlineDefault.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/kt18689.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/kt18689_2.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/kt18689_3.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/kt18689_4.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReference.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnInt.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnLong.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReference.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnInt.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnLong.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/constuctorReference.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/functionImportedFromObject.kt rename backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/{ => callableReferences}/functionReference.kt (85%) rename backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/{ => callableReferences}/functionReferenceFromClass.kt (83%) create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/functionReferenceFromObject.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/innerClassConstuctorReference.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/privateFunctionReference.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/privatePropertyReference.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/propertyImportedFromObject.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/propertyReference.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/propertyReferenceFromClass.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/propertyReferenceFromObject.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/receiverClash.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/receiverClash2.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/receiverClashInClass.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/receiverClashInClass2.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleExtension.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/thisClash.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/thisClashInClass.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/maskElimination/kt18792.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/maskElimination/kt19679.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/maskElimination/kt19679_2.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/maskElimination/kt19679_3.kt create mode 100644 backend.native/tests/external/codegen/boxInline/defaultValues/varArgNoInline.kt create mode 100644 backend.native/tests/external/codegen/boxInline/delegatedProperty/kt16864.kt create mode 100644 backend.native/tests/external/codegen/boxInline/delegatedProperty/localInAnonymousObject.kt create mode 100644 backend.native/tests/external/codegen/boxInline/delegatedProperty/localInLambda.kt create mode 100644 backend.native/tests/external/codegen/boxInline/jvmPackageName/simple.kt create mode 100644 backend.native/tests/external/codegen/boxInline/reified/defaultLambda/chain.kt create mode 100644 backend.native/tests/external/codegen/boxInline/reified/defaultLambda/nested.kt create mode 100644 backend.native/tests/external/codegen/boxInline/reified/defaultLambda/nested2.kt create mode 100644 backend.native/tests/external/codegen/boxInline/reified/defaultLambda/nested2Static.kt create mode 100644 backend.native/tests/external/codegen/boxInline/reified/defaultLambda/nestedStatic.kt create mode 100644 backend.native/tests/external/codegen/boxInline/reified/defaultLambda/simple.kt create mode 100644 backend.native/tests/external/codegen/boxInline/reified/defaultLambda/transitiveChain.kt create mode 100644 backend.native/tests/external/codegen/boxInline/reified/defaultLambda/transitiveChainStatic.kt create mode 100644 backend.native/tests/external/codegen/boxInline/smap/anonymous/kt19175.kt create mode 100644 backend.native/tests/external/codegen/boxInline/smap/defaultFunction.kt create mode 100644 backend.native/tests/external/codegen/boxInline/smap/defaultLambda/nested.kt create mode 100644 backend.native/tests/external/codegen/boxInline/smap/defaultLambda/simple.kt create mode 100644 backend.native/tests/external/compileKotlinAgainstKotlin/jvmPackageName.kt create mode 100644 backend.native/tests/external/compileKotlinAgainstKotlin/jvmPackageNameInRootPackage.kt create mode 100644 backend.native/tests/external/compileKotlinAgainstKotlin/jvmPackageNameWithJvmName.kt create mode 100644 backend.native/tests/external/compileKotlinAgainstKotlin/multifileClassWithTypealias.kt create mode 100644 backend.native/tests/external/compileKotlinAgainstKotlin/targetedJvmName.kt diff --git a/backend.native/tests/build.gradle b/backend.native/tests/build.gradle index c5aeca822f6..434ac74358c 100644 --- a/backend.native/tests/build.gradle +++ b/backend.native/tests/build.gradle @@ -33,7 +33,7 @@ repositories { dependencies { cli_bc project(path: ':backend.native', configuration: 'cli_bc') - update_tests (group: 'org', name: 'bt345', version: testDataVersion) { + update_tests (group: 'org', name: 'Kotlin_120_Compiler', version: testDataVersion) { artifact { name = 'internal/kotlin-test-data' type = 'zip' diff --git a/backend.native/tests/external/codegen/box/argumentOrder/argumentOrderInObjectSuperCall.kt b/backend.native/tests/external/codegen/box/argumentOrder/argumentOrderInObjectSuperCall.kt new file mode 100644 index 00000000000..b194d4365b3 --- /dev/null +++ b/backend.native/tests/external/codegen/box/argumentOrder/argumentOrderInObjectSuperCall.kt @@ -0,0 +1,10 @@ +var result = "fail" + +open class Base(val o: String, val k: String) + +fun box(): String { + val obj1 = object : Base(k = { result = "O"; "K"}() , o = {result += "K"; "O"}()) {} + + if (result != "OK") return "fail $result" + return obj1.o + obj1.k +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/argumentOrder/argumentOrderInSuperCall.kt b/backend.native/tests/external/codegen/box/argumentOrder/argumentOrderInSuperCall.kt new file mode 100644 index 00000000000..042a5dcbae6 --- /dev/null +++ b/backend.native/tests/external/codegen/box/argumentOrder/argumentOrderInSuperCall.kt @@ -0,0 +1,11 @@ +var result = "fail" + +open class Base(val o: String, val k: String) +class Derived : Base(k = { result = "O"; "K"}() , o = {result += "K"; "O"}()) {} + +fun box(): String { + val derived = Derived() + + if (result != "OK") return "fail $result" + return derived.o + derived.k +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/argumentOrder/varargAndDefaultParameters_ForNative.kt b/backend.native/tests/external/codegen/box/argumentOrder/varargAndDefaultParameters_ForNative.kt new file mode 100644 index 00000000000..969dc8e84f8 --- /dev/null +++ b/backend.native/tests/external/codegen/box/argumentOrder/varargAndDefaultParameters_ForNative.kt @@ -0,0 +1,54 @@ +// NO_CHECK_LAMBDA_INLINING +// FILE: 1.kt +// WITH_RUNTIME +// TARGET_BACKEND: NATIVE +package test + +open class A(val value: String) + +var invokeOrder = "" + +inline fun inlineFun( + vararg constraints: A, + receiver: String = { invokeOrder += " default receiver"; "DEFAULT" }(), + init: String +): String { + return constraints.map { it.value }.joinToString() + ", " + receiver + ", " + init +} + +// FILE: 2.kt +import test.* + + +var result = "" +fun box(): String { + + result = "" + invokeOrder = "" + result = inlineFun(constraints = { invokeOrder += "constraints";A("C") }(), + receiver = { invokeOrder += " receiver"; "R" }(), + init = { invokeOrder += " init"; "I" }()) + if (result != "C, R, I") return "fail 1: $result" + + if (invokeOrder != "constraints receiver init") return "fail 2: $invokeOrder" + + result = "" + invokeOrder = "" + result = inlineFun(init = { invokeOrder += "init"; "I" }(), + constraints = { invokeOrder += "constraints";A("C") }(), + receiver = { invokeOrder += " receiver"; "R" }() + ) + if (result != "C, R, I") return "fail 3: $result" + //Change test after KT-17691 FIX + if (invokeOrder != "init receiverconstraints") return "fail 4: $invokeOrder" + + result = "" + invokeOrder = "" + result = inlineFun(init = { invokeOrder += "init"; "I" }(), + constraints = { invokeOrder += " constraints";A("C") }()) + if (result != "C, DEFAULT, I") return "fail 5: $result" + if (invokeOrder != "init constraints default receiver") return "fail 6: $invokeOrder" + + return "OK" +} + diff --git a/backend.native/tests/external/codegen/box/arrays/nonLocalReturnArrayConstructor.kt b/backend.native/tests/external/codegen/box/arrays/nonLocalReturnArrayConstructor.kt index 3becef59c2a..f87032e9a3b 100644 --- a/backend.native/tests/external/codegen/box/arrays/nonLocalReturnArrayConstructor.kt +++ b/backend.native/tests/external/codegen/box/arrays/nonLocalReturnArrayConstructor.kt @@ -45,6 +45,7 @@ fun testFloatArray() { } throw AssertionError() } + fun testDoubleArray() { DoubleArray(5) { i -> if (i == 3) return diff --git a/backend.native/tests/external/codegen/box/arrays/primitiveArrays.kt b/backend.native/tests/external/codegen/box/arrays/primitiveArrays.kt index 0948cacd472..86e2b17cb5a 100644 --- a/backend.native/tests/external/codegen/box/arrays/primitiveArrays.kt +++ b/backend.native/tests/external/codegen/box/arrays/primitiveArrays.kt @@ -1,9 +1,6 @@ // WITH_RUNTIME -import kotlin.test.assertTrue -import kotlin.test.assertFalse -import kotlin.test.assertEquals -import kotlin.test.assertFails +import kotlin.test.* fun box(): String { assertTrue(eqBoolean(booleanArrayOf(false), BooleanArray(1))) diff --git a/backend.native/tests/external/codegen/box/boxingOptimization/boxedIntegersCmp.kt b/backend.native/tests/external/codegen/box/boxingOptimization/boxedIntegersCmp.kt new file mode 100644 index 00000000000..1a181d9b391 --- /dev/null +++ b/backend.native/tests/external/codegen/box/boxingOptimization/boxedIntegersCmp.kt @@ -0,0 +1,46 @@ +inline fun ltx(a: Comparable, b: Any) = a < b +inline fun lex(a: Comparable, b: Any) = a <= b +inline fun gex(a: Comparable, b: Any) = a >= b +inline fun gtx(a: Comparable, b: Any) = a > b + +inline fun lt(a: Any, b: Any) = ltx(a as Comparable, b) +inline fun le(a: Any, b: Any) = lex(a as Comparable, b) +inline fun ge(a: Any, b: Any) = gex(a as Comparable, b) +inline fun gt(a: Any, b: Any) = gtx(a as Comparable, b) + +val ONE = 1 +val ONEL = 1L + +fun box(): String { + return when { + !lt(ONE, 42) -> "Fail 1 LT" + lt(42, ONE) -> "Fail 2 LT" + + !le(ONE, 42) -> "Fail 1 LE" + le(42, ONE) -> "Fail 2 LE" + !le(1, ONE) -> "Fail 3 LE" + + !ge(42, ONE) -> "Fail 1 GE" + ge(ONE, 42) -> "Fail 2 GE" + !ge(1, ONE) -> "Fail 3 GE" + + gt(ONE, 42) -> "Fail 1 GT" + !gt(42, ONE) -> "Fail 2 GT" + + !lt(ONEL, 42L) -> "Fail 1 LT L" + lt(42L, ONEL) -> "Fail 2 LT L" + + !le(ONEL, 42L) -> "Fail 1 LE L" + le(42L, ONEL) -> "Fail 2 LE L" + !le(ONEL, 1L) -> "Fail 3 LE L" + + !ge(42L, ONEL) -> "Fail 1 GE L" + ge(ONEL, 42L) -> "Fail 2 GE L" + !ge(ONEL, 1L) -> "Fail 3 GE L" + + gt(ONEL, 42L) -> "Fail 1 GT L" + !gt(42L, ONEL) -> "Fail 2 GT L" + + else -> "OK" + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/boxingOptimization/boxedPrimitivesAreEqual.kt b/backend.native/tests/external/codegen/box/boxingOptimization/boxedPrimitivesAreEqual.kt new file mode 100644 index 00000000000..2bd8eda1ddd --- /dev/null +++ b/backend.native/tests/external/codegen/box/boxingOptimization/boxedPrimitivesAreEqual.kt @@ -0,0 +1,21 @@ +inline fun eq(a: Any, b: Any) = a == b +inline fun ne(a: Any, b: Any) = a != b + +val ONE = 1 +val ONEL = 1L + +fun box(): String { + return when { + eq(ONE, 2) -> "Fail 1" + !eq(ONE, 1) -> "Fail 2" + !ne(ONE, 2) -> "Fail 3" + ne(ONE, 1) -> "Fail 4" + + eq(ONEL, 42L) -> "Fail 1L" + !eq(ONEL, 1L) -> "Fail 2L" + !ne(ONEL, 42L) -> "Fail 3L" + ne(ONEL, 1L) -> "Fail 4L" + + else -> "OK" + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/boxingOptimization/boxedRealsCmp.kt b/backend.native/tests/external/codegen/box/boxingOptimization/boxedRealsCmp.kt new file mode 100644 index 00000000000..20db67feeb0 --- /dev/null +++ b/backend.native/tests/external/codegen/box/boxingOptimization/boxedRealsCmp.kt @@ -0,0 +1,82 @@ +// IGNORE_BACKEND: JS, NATIVE + +inline fun ltx(a: Comparable, b: Any) = a < b +inline fun lex(a: Comparable, b: Any) = a <= b +inline fun gex(a: Comparable, b: Any) = a >= b +inline fun gtx(a: Comparable, b: Any) = a > b + +inline fun lt(a: Any, b: Any) = ltx(a as Comparable, b) +inline fun le(a: Any, b: Any) = lex(a as Comparable, b) +inline fun ge(a: Any, b: Any) = gex(a as Comparable, b) +inline fun gt(a: Any, b: Any) = gtx(a as Comparable, b) + +val PLUS0F = 0.0F +val MINUS0F = -0.0F +val PLUS0D = 0.0 +val MINUS0D = -0.0 + +fun box(): String { + return when { + !lt(1.0F, 42.0F) -> "Fail 1 LT F" + lt(42.0F, 1.0F) -> "Fail 2 LT F" + + !le(1.0F, 42.0F) -> "Fail 1 LE F" + le(42.0F, 1.0F) -> "Fail 2 LE F" + !le(1.0F, 1.0F) -> "Fail 3 LE F" + + !ge(42.0F, 1.0F) -> "Fail 1 GE F" + ge(1.0F, 42.0F) -> "Fail 2 GE F" + !ge(1.0F, 1.0F) -> "Fail 3 GE F" + + gt(1.0F, 42.0F) -> "Fail 1 GT F" + !gt(42.0F, 1.0F) -> "Fail 2 GT F" + + !lt(1.0, 42.0) -> "Fail 1 LT D" + lt(42.0, 1.0) -> "Fail 2 LT D" + + !le(1.0, 42.0) -> "Fail 1 LE D" + le(42.0, 1.0) -> "Fail 2 LE D" + !le(1.0, 1.0) -> "Fail 3 LE D" + + !ge(42.0, 1.0) -> "Fail 1 GE D" + ge(1.0, 42.0) -> "Fail 2 GE D" + !ge(1.0, 1.0) -> "Fail 3 GE D" + + gt(1.0, 42.0) -> "Fail 1 GT D" + !gt(42.0, 1.0) -> "Fail 2 GT D" + + !lt(MINUS0F, PLUS0F) -> "Fail 1 LT +-0 F" + lt(PLUS0F, MINUS0F) -> "Fail 2 LT +-0 F" + + !le(MINUS0F, PLUS0F) -> "Fail 1 LE +-0 F" + le(PLUS0F, MINUS0F) -> "Fail 2 LE +-0 F" + !le(MINUS0F, MINUS0F) -> "Fail 3 LE +-0 F" + !le(PLUS0F, PLUS0F) -> "Fail 3 LE +-0 F" + + ge(MINUS0F, PLUS0F) -> "Fail 1 GE +-0 F" + !ge(PLUS0F, MINUS0F) -> "Fail 2 GE +-0 F" + !ge(MINUS0F, MINUS0F) -> "Fail 3 GE +-0 F" + !ge(PLUS0F, PLUS0F) -> "Fail 3 GE +-0 F" + + gt(MINUS0F, PLUS0F) -> "Fail 1 GT +-0 F" + !gt(PLUS0F, MINUS0F) -> "Fail 2 GT +-0 F" + + !lt(MINUS0D, PLUS0D) -> "Fail 1 LT +-0 D" + lt(PLUS0D, MINUS0D) -> "Fail 2 LT +-0 D" + + !le(MINUS0D, PLUS0D) -> "Fail 1 LE +-0 D" + le(PLUS0D, MINUS0D) -> "Fail 2 LE +-0 D" + !le(MINUS0D, MINUS0D) -> "Fail 3 LE +-0 D" + !le(PLUS0D, PLUS0D) -> "Fail 3 LE +-0 D" + + ge(MINUS0D, PLUS0D) -> "Fail 1 GE +-0 D" + !ge(PLUS0D, MINUS0D) -> "Fail 2 GE +-0 D" + !ge(MINUS0D, MINUS0D) -> "Fail 3 GE +-0 D" + !ge(PLUS0D, PLUS0D) -> "Fail 3 GE +-0 D" + + gt(MINUS0D, PLUS0D) -> "Fail 1 GT +-0 D" + !gt(PLUS0D, MINUS0D) -> "Fail 2 GT +-0 D" + + else -> "OK" + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/boxingOptimization/intCompareTo.kt b/backend.native/tests/external/codegen/box/boxingOptimization/intCompareTo.kt new file mode 100644 index 00000000000..e3016ff7bbe --- /dev/null +++ b/backend.native/tests/external/codegen/box/boxingOptimization/intCompareTo.kt @@ -0,0 +1,8 @@ +fun box(): String { + val a: Any = 1 + val b: Any = 42 + val test = (a as Comparable).compareTo(b) + if (test != -1) return "Fail: $test" + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/boxingOptimization/kClassEquals.kt b/backend.native/tests/external/codegen/box/boxingOptimization/kClassEquals.kt new file mode 100644 index 00000000000..635e9949a6f --- /dev/null +++ b/backend.native/tests/external/codegen/box/boxingOptimization/kClassEquals.kt @@ -0,0 +1,20 @@ +// TARGET_BACKEND: JVM + +fun test(a: Any) = when (a::class) { + String::class -> "String" + Int::class -> "Int" + Boolean::class -> "Boolean" + else -> "Else" +} + +fun box(): String { + val s = "" + val i = 0 + val b = false + + if (test(s) != "String") return "Fail 1" + if (test(i) != "Int") return "Fail 2" + if (test(b) != "Boolean") return "Fail 3" + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/boxingOptimization/kt17748.kt b/backend.native/tests/external/codegen/box/boxingOptimization/kt17748.kt new file mode 100644 index 00000000000..1639def43c6 --- /dev/null +++ b/backend.native/tests/external/codegen/box/boxingOptimization/kt17748.kt @@ -0,0 +1,17 @@ +// TARGET_BACKEND: JVM + +fun box(): String { + 42.doSwitchInt() + "".doSwitchString() + return "OK" +} + +inline fun E.doSwitchInt(): String = when (E::class) { + Int::class -> "success!" + else -> throw AssertionError() +} + +inline fun E.doSwitchString(): String = when(E::class) { + String::class -> "success!" + else -> throw AssertionError() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/boxingOptimization/kt19767.kt b/backend.native/tests/external/codegen/box/boxingOptimization/kt19767.kt new file mode 100644 index 00000000000..bb00ac53fa6 --- /dev/null +++ b/backend.native/tests/external/codegen/box/boxingOptimization/kt19767.kt @@ -0,0 +1,21 @@ +fun foo(p: Int?): Boolean { + return M(p)?.nulled() == 1 +} + +fun foo2(p: Int?): Boolean { + return 1 == M(p)?.nulled() +} + +class M(val z: T?) { + fun nulled(): T? = z +} + + +fun box(): String { + if (foo(null)) return "fail 1" + if (!foo(1)) return "fail 2" + + if (foo2(null)) return "fail 1" + if (!foo2(1)) return "fail 2" + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/boxingOptimization/kt19767_2.kt b/backend.native/tests/external/codegen/box/boxingOptimization/kt19767_2.kt new file mode 100644 index 00000000000..8f0913523f9 --- /dev/null +++ b/backend.native/tests/external/codegen/box/boxingOptimization/kt19767_2.kt @@ -0,0 +1,6 @@ +//WITH_RUNTIME + +fun box(): String { + val map: Map? = mapOf() + return if (map?.get("") == true) "fail" else "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/boxingOptimization/kt19767_3.kt b/backend.native/tests/external/codegen/box/boxingOptimization/kt19767_3.kt new file mode 100644 index 00000000000..cf8f6d9063e --- /dev/null +++ b/backend.native/tests/external/codegen/box/boxingOptimization/kt19767_3.kt @@ -0,0 +1,34 @@ +// IGNORE_BACKEND: JS, NATIVE + +// FILE: M.java + +public class M { + private final Integer value; + + public M(Integer value) { + this.value = value; + } + + public Integer nulled() { + return value; + } +} + + +// FILE: Kotlin.kt +fun foo(p: Int?): Boolean { + return M(p)?.nulled() == 1 +} + +fun foo2(p: Int?): Boolean { + return 1 == M(p)?.nulled() +} + +fun box(): String { + if (foo(null)) return "fail 1" + if (!foo(1)) return "fail 2" + + if (foo2(null)) return "fail 1" + if (!foo2(1)) return "fail 2" + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/boxingOptimization/kt19767_chain.kt b/backend.native/tests/external/codegen/box/boxingOptimization/kt19767_chain.kt new file mode 100644 index 00000000000..441714d90b2 --- /dev/null +++ b/backend.native/tests/external/codegen/box/boxingOptimization/kt19767_chain.kt @@ -0,0 +1,23 @@ +fun foo(p: Int?): Boolean { + return M(p)?.chain()?.nulled() == 1 +} + +fun foo2(p: Int?): Boolean { + return 1 == M(p)?.chain()?.nulled() +} + +class M(val z: T?) { + fun nulled(): T? = z + + fun chain(): M? = this +} + + +fun box(): String { + if (foo(null)) return "fail 1" + if (!foo(1)) return "fail 2" + + if (foo2(null)) return "fail 1" + if (!foo2(1)) return "fail 2" + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/boxingOptimization/maxMinBy.kt b/backend.native/tests/external/codegen/box/boxingOptimization/maxMinBy.kt new file mode 100644 index 00000000000..00adbc52f4c --- /dev/null +++ b/backend.native/tests/external/codegen/box/boxingOptimization/maxMinBy.kt @@ -0,0 +1,20 @@ +// WITH_RUNTIME + +fun box(): String { + val intList = listOf(1, 2, 3) + val longList = listOf(1L, 2L, 3L) + + val intListMin = intList.minBy { it } + if (intListMin != 1) return "Fail intListMin=$intListMin" + + val intListMax = intList.maxBy { it } + if (intListMax != 3) return "Fail intListMax=$intListMax" + + val longListMin = longList.minBy { it } + if (longListMin != 1L) return "Fail longListMin=$longListMin" + + val longListMax = longList.maxBy { it } + if (longListMax != 3L) return "Fail longListMax=$longListMax" + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/callableReference/bound/emptyLHS.kt b/backend.native/tests/external/codegen/box/callableReference/bound/emptyLHS.kt new file mode 100644 index 00000000000..be2bcc0b918 --- /dev/null +++ b/backend.native/tests/external/codegen/box/callableReference/bound/emptyLHS.kt @@ -0,0 +1,57 @@ +// LANGUAGE_VERSION: 1.2 + +var result = "" + +class A { + fun memberFunction() { result += "A.mf," } + fun aMemberFunction() { result += "A.amf," } + val memberProperty: Int get() = 42.also { result += "A.mp," } + val aMemberProperty: Int get() = 42.also { result += "A.amp," } + + fun test(): String { + (::memberFunction)() + (::aExtensionFunction)() + + (::memberProperty)() + (::aExtensionProperty)() + + return result + } + + inner class B { + fun memberFunction() { result += "B.mf," } + val memberProperty: Int get() = 42.also { result += "B.mp," } + + fun test(): String { + (::aMemberFunction)() + (::aExtensionFunction)() + + (::aMemberProperty)() + (::aExtensionProperty)() + + (::memberFunction)() + (::memberProperty)() + + (::bExtensionFunction)() + (::bExtensionProperty)() + + return result + } + } +} + +fun A.aExtensionFunction() { result += "A.ef," } +val A.aExtensionProperty: Int get() = 42.also { result += "A.ep," } +fun A.B.bExtensionFunction() { result += "B.ef," } +val A.B.bExtensionProperty: Int get() = 42.also { result += "B.ep," } + +fun box(): String { + val a = A().test() + if (a != "A.mf,A.ef,A.mp,A.ep,") return "Fail $a" + + result = "" + val b = A().B().test() + if (b != "A.amf,A.ef,A.amp,A.ep,B.mf,B.mp,B.ef,B.ep,") return "Fail $b" + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/callableReference/bound/equals/propertyAccessors.kt b/backend.native/tests/external/codegen/box/callableReference/bound/equals/propertyAccessors.kt index 523c068304c..17016fd88b0 100644 --- a/backend.native/tests/external/codegen/box/callableReference/bound/equals/propertyAccessors.kt +++ b/backend.native/tests/external/codegen/box/callableReference/bound/equals/propertyAccessors.kt @@ -3,7 +3,8 @@ // WITH_REFLECT -import kotlin.reflect.* +import kotlin.reflect.KMutableProperty1 +import kotlin.reflect.full.* class C { var prop = 42 diff --git a/backend.native/tests/external/codegen/box/callableReference/bound/equals/reflectionReference.kt b/backend.native/tests/external/codegen/box/callableReference/bound/equals/reflectionReference.kt index 629d652a499..b0e6ca50b37 100644 --- a/backend.native/tests/external/codegen/box/callableReference/bound/equals/reflectionReference.kt +++ b/backend.native/tests/external/codegen/box/callableReference/bound/equals/reflectionReference.kt @@ -3,7 +3,7 @@ // WITH_REFLECT -import kotlin.reflect.* +import kotlin.reflect.full.* class C { fun foo() {} diff --git a/backend.native/tests/external/codegen/box/callableReference/bound/localUnitFunction.kt b/backend.native/tests/external/codegen/box/callableReference/bound/localUnitFunction.kt new file mode 100644 index 00000000000..dcb5c44738b --- /dev/null +++ b/backend.native/tests/external/codegen/box/callableReference/bound/localUnitFunction.kt @@ -0,0 +1,9 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME + +fun box(): String { + fun foo(): Unit {} + assert(Unit.javaClass.equals(foo().javaClass)) + assert(Unit.javaClass.equals(foo()::class.java)) + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/callableReference/function/innerClassConstructorWithTwoReceivers.kt b/backend.native/tests/external/codegen/box/callableReference/function/innerClassConstructorWithTwoReceivers.kt new file mode 100644 index 00000000000..35fa6ffc598 --- /dev/null +++ b/backend.native/tests/external/codegen/box/callableReference/function/innerClassConstructorWithTwoReceivers.kt @@ -0,0 +1,20 @@ +abstract class A { + inner class InnerInA { + fun returnOk() = "OK" + } +} + +class B : A() + +fun foo(a: A): String { + if (a is B) { + val v = a::InnerInA + return v().returnOk() + } + + return "error" +} + +fun box(): String { + return foo(B()) +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/casts/isNullablePrimitive.kt b/backend.native/tests/external/codegen/box/casts/isNullablePrimitive.kt new file mode 100644 index 00000000000..6a820551736 --- /dev/null +++ b/backend.native/tests/external/codegen/box/casts/isNullablePrimitive.kt @@ -0,0 +1,48 @@ +fun box(): String { + val n: Any? = null + + val intV: Any? = 23 + val floatV: Any? = 23.4F + val doubleV: Any? = 23.45 + val longV: Any? = 234L + val stringV: Any? = "foo" + val booleanV: Any? = true + val functionV: Any? = { x: Int -> x + 1 } + + if (n !is Int?) return "fail: null !is Int?" + if (n !is Float?) return "fail: null !is Float?" + if (n !is Double?) return "fail: null !is Double?" + if (n !is String?) return "fail: null !is String?" + if (n !is Boolean?) return "fail: null !is Boolean?" + if (n !is Function1<*, *>?) return "fail: null !is Function?" + + if (n is Int) return "fail: null is Int" + if (n is Float) return "fail: null is Float" + if (n is Double) return "fail: null is Double" + if (n is String) return "fail: null is String" + if (n is Boolean) return "fail: null is Boolean" + if (n is Function1<*, *>) return "fail: null is Function" + + if (intV !is Int?) return "fail: 23 !is Int?" + if (intV is String?) return "fail: 23 is String?" + + if (floatV !is Float?) return "fail: 23.4F !is Float?" + if (floatV is String?) return "fail: 23.4F is String?" + + if (doubleV !is Double?) return "fail: 23.45 !is Double?" + if (doubleV is String?) return "fail: 23.45 is String?" + + if (longV !is Long?) return "fail: 234L !is Long?" + if (longV is String?) return "fail: 234L is String?" + + if (stringV !is String?) return "fail: 'foo' !is String?" + if (stringV is Double?) return "fail: 'foo' is Double?" + + if (booleanV !is Boolean?) return "fail: true !is Boolean?" + if (booleanV is Double?) return "fail: true is Double?" + + if (functionV !is Function1<*, *>?) return "fail: !is Function?" + if (functionV is String?) return "fail: is String?" + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/casts/lambdaToUnitCast.kt b/backend.native/tests/external/codegen/box/casts/lambdaToUnitCast.kt index 42a86dcbb07..94ddfb05c00 100644 --- a/backend.native/tests/external/codegen/box/casts/lambdaToUnitCast.kt +++ b/backend.native/tests/external/codegen/box/casts/lambdaToUnitCast.kt @@ -1,6 +1,3 @@ -// IGNORE_BACKEND: JS -// JS backend does not support Unit well. See KT-13932 - val foo: () -> Unit = {} fun box(): String { diff --git a/backend.native/tests/external/codegen/box/casts/unitAsAny.kt b/backend.native/tests/external/codegen/box/casts/unitAsAny.kt index d05da99581f..74326356cba 100644 --- a/backend.native/tests/external/codegen/box/casts/unitAsAny.kt +++ b/backend.native/tests/external/codegen/box/casts/unitAsAny.kt @@ -1,6 +1,3 @@ -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - fun println(s: String) { } diff --git a/backend.native/tests/external/codegen/box/casts/unitAsSafeAny.kt b/backend.native/tests/external/codegen/box/casts/unitAsSafeAny.kt index 6412c65526f..81d5a495425 100644 --- a/backend.native/tests/external/codegen/box/casts/unitAsSafeAny.kt +++ b/backend.native/tests/external/codegen/box/casts/unitAsSafeAny.kt @@ -1,6 +1,3 @@ -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - fun println(s: String) { } diff --git a/backend.native/tests/external/codegen/box/checkcastOptimization/kt19128.kt b/backend.native/tests/external/codegen/box/checkcastOptimization/kt19128.kt new file mode 100644 index 00000000000..07117907188 --- /dev/null +++ b/backend.native/tests/external/codegen/box/checkcastOptimization/kt19128.kt @@ -0,0 +1,26 @@ +class A + +class B + +class C + +fun foo(parameters: Any?): Any? { + var payload: Any? = null + + if (parameters != null) { + if (parameters is A || parameters is B) { + payload = parameters + } else { + payload = "O" + } + } + + if (payload is String) { + payload += "K" + } + + return payload +} + +fun box(): String = + "${foo(C())}" \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/checkcastOptimization/kt19246.kt b/backend.native/tests/external/codegen/box/checkcastOptimization/kt19246.kt new file mode 100644 index 00000000000..7fce122da6a --- /dev/null +++ b/backend.native/tests/external/codegen/box/checkcastOptimization/kt19246.kt @@ -0,0 +1,19 @@ +// WITH_RUNTIME + +enum class ResultType constructor(val reason: String) { + SOMETHING("123"), + OK("OK"), + UNKNOWN("FAIL"); + + companion object { + fun getByVal(reason: String): ResultType { + return ResultType.values().firstOrDefault({ it.reason == reason }, UNKNOWN) + } + } +} + +inline fun Array.firstOrDefault(predicate: (T) -> Boolean, default: T): T { + return firstOrNull(predicate) ?: default +} + +fun box(): String = ResultType.getByVal("OK").reason diff --git a/backend.native/tests/external/codegen/box/classes/comanionObjectFieldVsClassField.kt b/backend.native/tests/external/codegen/box/classes/comanionObjectFieldVsClassField.kt new file mode 100644 index 00000000000..12667820fd5 --- /dev/null +++ b/backend.native/tests/external/codegen/box/classes/comanionObjectFieldVsClassField.kt @@ -0,0 +1,15 @@ +// WITH_RUNTIME + +class Host { + val ok = "OK" + + fun foo() = run { bar(ok) } + + companion object { + val ok = 0 + + fun bar(s: String) = s.substring(ok) + } +} + +fun box() = Host().foo() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/classes/kt508.kt b/backend.native/tests/external/codegen/box/classes/kt508.kt index d26dfafd6c0..54557146984 100644 --- a/backend.native/tests/external/codegen/box/classes/kt508.kt +++ b/backend.native/tests/external/codegen/box/classes/kt508.kt @@ -1,7 +1,3 @@ -// TODO: Enable for JS when it supports Java class library. -// IGNORE_BACKEND: JS -// fails on JS with TypeError: imported$plus is not a function, it is undefined. - operator fun MutableMap.set(key : K, value : V) = put(key, value) fun box() : String { diff --git a/backend.native/tests/external/codegen/box/classes/quotedClassName.kt b/backend.native/tests/external/codegen/box/classes/quotedClassName.kt new file mode 100644 index 00000000000..0031c7032b0 --- /dev/null +++ b/backend.native/tests/external/codegen/box/classes/quotedClassName.kt @@ -0,0 +1,9 @@ +// IGNORE_BACKEND: JS + +class `A!u00A0`() { + val ok = "OK" +} + +fun box(): String { + return `A!u00A0`().ok +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/constants/kt9532.kt b/backend.native/tests/external/codegen/box/constants/kt9532.kt index e600cc309c1..bdf0164b927 100644 --- a/backend.native/tests/external/codegen/box/constants/kt9532.kt +++ b/backend.native/tests/external/codegen/box/constants/kt9532.kt @@ -1,5 +1,5 @@ // TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS, NATIVE +// IGNORE_BACKEND: NATIVE object A { const val a: String = "$" @@ -7,7 +7,7 @@ object A { const val c = 10000 val bNonConst = "1234$a" - val bNullable: String = "1234$a" + val bNullable: String? = "1234$a" } object B { @@ -16,7 +16,7 @@ object B { const val c = 10000 val bNonConst = "1234$a" - val bNullable: String = "1234$a" + val bNullable: String? = "1234$a" } fun box(): String { @@ -26,8 +26,8 @@ fun box(): String { if (A.c !== B.c) return "Fail 3: A.c !== B.c" - if (A.bNonConst === B.bNonConst) return "Fail 5: A.bNonConst == B.bNonConst" - if (A.bNullable === B.bNullable) return "Fail 6: A.bNullable == B.bNullable" + if (A.bNonConst !== B.bNonConst) return "Fail 4: A.bNonConst !== B.bNonConst" + if (A.bNullable !== B.bNullable) return "Fail 5: A.bNullable !== B.bNullable" return "OK" } \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/constants/kt9532_lv10.kt b/backend.native/tests/external/codegen/box/constants/kt9532_lv10.kt new file mode 100644 index 00000000000..828d90fa11a --- /dev/null +++ b/backend.native/tests/external/codegen/box/constants/kt9532_lv10.kt @@ -0,0 +1,34 @@ +// TODO: muted automatically, investigate should it be ran for JS or not +// IGNORE_BACKEND: JS +// LANGUAGE_VERSION: 1.0 + +object A { + const val a: String = "$" + const val b = "1234$a" + const val c = 10000 + + val bNonConst = "1234$a" + val bNullable: String? = "1234$a" +} + +object B { + const val a: String = "$" + const val b = "1234$a" + const val c = 10000 + + val bNonConst = "1234$a" + val bNullable: String? = "1234$a" +} + +fun box(): String { + if (A.a !== B.a) return "Fail 1: A.a !== B.a" + + if (A.b !== B.b) return "Fail 2: A.b !== B.b" + + if (A.c !== B.c) return "Fail 3: A.c !== B.c" + + if (A.bNonConst === B.bNonConst) return "Fail 4: A.bNonConst === B.bNonConst" + if (A.bNullable === B.bNullable) return "Fail 5: A.bNullable === B.bNullable" + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/constructorCall/breakInConstructorArguments.kt b/backend.native/tests/external/codegen/box/constructorCall/breakInConstructorArguments.kt new file mode 100644 index 00000000000..13e8ce2d951 --- /dev/null +++ b/backend.native/tests/external/codegen/box/constructorCall/breakInConstructorArguments.kt @@ -0,0 +1,39 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +fun box(): String { + var count = 0 + while (true) { + Foo( + logged("i", if (count == 0) 1 else break), + logged("j", 2) + ) + count++ + } + + val result = log.toString() + if (result != "ij") return "Fail: '$result'" + + return "OK" +} + +// FILE: util.kt +val log = StringBuilder() + +fun logged(msg: String, value: T): T { + log.append(msg) + return value +} + +// FILE: Foo.kt +class Foo(i: Int, j: Int) { + init { + log.append("") + } + + companion object { + init { + log.append("") + } + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/constructorCall/continueInConstructorArguments.kt b/backend.native/tests/external/codegen/box/constructorCall/continueInConstructorArguments.kt new file mode 100644 index 00000000000..52d81e4f22c --- /dev/null +++ b/backend.native/tests/external/codegen/box/constructorCall/continueInConstructorArguments.kt @@ -0,0 +1,40 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +fun box(): String { + var count = 0 + while (true) { + count++ + if (count > 1) break + Foo( + logged("i", if (count == 1) 1 else continue), + logged("j", 2) + ) + } + + val result = log.toString() + if (result != "ij") return "Fail: '$result'" + + return "OK" +} + +// FILE: util.kt +val log = StringBuilder() + +fun logged(msg: String, value: T): T { + log.append(msg) + return value +} + +// FILE: Foo.kt +class Foo(i: Int, j: Int) { + init { + log.append("") + } + + companion object { + init { + log.append("") + } + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/constructorCall/earlyReturnInConstructorArguments.kt b/backend.native/tests/external/codegen/box/constructorCall/earlyReturnInConstructorArguments.kt new file mode 100644 index 00000000000..3497418bfb0 --- /dev/null +++ b/backend.native/tests/external/codegen/box/constructorCall/earlyReturnInConstructorArguments.kt @@ -0,0 +1,41 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +inline fun ok(): String { + return foo(1, 1.0, 1.0f, 1L, "O", C(if (bar()) return "zap" else "K")) +} + +fun box(): String { + val ok = ok() + if (ok != "OK") return "Fail: $ok" + + val r = log.toString() + if (r != ";bar;;foo;") return "Fail: '$r'" + + return "OK" +} + +// FILE: C.kt +class C(val str: String) { + init { + log.append(";") + } + + companion object { + init { + log.append(";") + } + } +} + +// FILE: util.kt +fun foo(x: Int, a: Double, b: Float, y: Long, z: String, c: C) = + logged("foo;", z + c.str) + +fun bar() = logged("bar;", false) + +val log = StringBuilder() + +fun logged(msg: String, value: T): T { + log.append(msg) + return value +} diff --git a/backend.native/tests/external/codegen/box/constructorCall/inlineFunInConstructorCallEvaluationOrder.kt b/backend.native/tests/external/codegen/box/constructorCall/inlineFunInConstructorCallEvaluationOrder.kt new file mode 100644 index 00000000000..6a07675236f --- /dev/null +++ b/backend.native/tests/external/codegen/box/constructorCall/inlineFunInConstructorCallEvaluationOrder.kt @@ -0,0 +1,40 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +fun box(): String { + Foo( + logged("i", 1.let { it }), + logged("j", + Foo( + logged("k", 2.let { it }), + null + ) + ) + ) + + val result = log.toString() + if (result != "ikj") return "Fail: '$result'" + + return "OK" +} + +// FILE: util.kt +val log = StringBuilder() + +fun logged(msg: String, value: T): T { + log.append(msg) + return value +} + +// FILE: Foo.kt +class Foo(i: Int, j: Foo?) { + init { + log.append("") + } + + companion object { + init { + log.append("") + } + } +} diff --git a/backend.native/tests/external/codegen/box/constructorCall/inlineFunInConstructorCallWithDisabledNormalization.kt b/backend.native/tests/external/codegen/box/constructorCall/inlineFunInConstructorCallWithDisabledNormalization.kt new file mode 100644 index 00000000000..79020cc9986 --- /dev/null +++ b/backend.native/tests/external/codegen/box/constructorCall/inlineFunInConstructorCallWithDisabledNormalization.kt @@ -0,0 +1,41 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// KOTLIN_CONFIGURATION_FLAGS: CONSTRUCTOR_CALL_NORMALIZATION_MODE=disable +// FILE: test.kt +fun box(): String { + Foo( + logged("i", 1.let { it }), + logged("j", + Foo( + logged("k", 2.let { it }), + null + ) + ) + ) + + val result = log.toString() + if (result != "ikj") return "Fail: '$result'" + + return "OK" +} + +// FILE: util.kt +val log = StringBuilder() + +fun logged(msg: String, value: T): T { + log.append(msg) + return value +} + +// FILE: Foo.kt +class Foo(i: Int, j: Foo?) { + init { + log.append("") + } + + companion object { + init { + log.append("") + } + } +} diff --git a/backend.native/tests/external/codegen/box/constructorCall/inlineFunInConstructorCallWithEnabledNormalization.kt b/backend.native/tests/external/codegen/box/constructorCall/inlineFunInConstructorCallWithEnabledNormalization.kt new file mode 100644 index 00000000000..64c7310ef57 --- /dev/null +++ b/backend.native/tests/external/codegen/box/constructorCall/inlineFunInConstructorCallWithEnabledNormalization.kt @@ -0,0 +1,41 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// KOTLIN_CONFIGURATION_FLAGS: CONSTRUCTOR_CALL_NORMALIZATION_MODE=enable +// FILE: test.kt +fun box(): String { + Foo( + logged("i", 1.let { it }), + logged("j", + Foo( + logged("k", 2.let { it }), + null + ) + ) + ) + + val result = log.toString() + if (result != "ikj") return "Fail: '$result'" + + return "OK" +} + +// FILE: util.kt +val log = StringBuilder() + +fun logged(msg: String, value: T): T { + log.append(msg) + return value +} + +// FILE: Foo.kt +class Foo(i: Int, j: Foo?) { + init { + log.append("") + } + + companion object { + init { + log.append("") + } + } +} diff --git a/backend.native/tests/external/codegen/box/constructorCall/inlineFunInConstructorCallWithStrictNormalization.kt b/backend.native/tests/external/codegen/box/constructorCall/inlineFunInConstructorCallWithStrictNormalization.kt new file mode 100644 index 00000000000..65ef307f5b8 --- /dev/null +++ b/backend.native/tests/external/codegen/box/constructorCall/inlineFunInConstructorCallWithStrictNormalization.kt @@ -0,0 +1,41 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// KOTLIN_CONFIGURATION_FLAGS: CONSTRUCTOR_CALL_NORMALIZATION_MODE=preserve-class-initialization +// FILE: test.kt +fun box(): String { + Foo( + logged("i", 1.let { it }), + logged("j", + Foo( + logged("k", 2.let { it }), + null + ) + ) + ) + + val result = log.toString() + if (result != "ikj") return "Fail: '$result'" + + return "OK" +} + +// FILE: util.kt +val log = StringBuilder() + +fun logged(msg: String, value: T): T { + log.append(msg) + return value +} + +// FILE: Foo.kt +class Foo(i: Int, j: Foo?) { + init { + log.append("") + } + + companion object { + init { + log.append("") + } + } +} diff --git a/backend.native/tests/external/codegen/box/constructorCall/inlineFunInInnerClassConstructorCall.kt b/backend.native/tests/external/codegen/box/constructorCall/inlineFunInInnerClassConstructorCall.kt new file mode 100644 index 00000000000..9292242e2b6 --- /dev/null +++ b/backend.native/tests/external/codegen/box/constructorCall/inlineFunInInnerClassConstructorCall.kt @@ -0,0 +1,43 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +fun box(): String { + Outer().Inner( + logged("i;", 1.let { it }), + logged("j;", 2.let { it }) + ) + + val result = log.toString() + if (result != "Foo.;i;j;Foo.;Inner.;") return "Fail: '$result'" + + return "OK" +} + +// FILE: util.kt +val log = StringBuilder() + +fun logged(msg: String, value: T): T { + log.append(msg) + return value +} + +// FILE: Foo.kt +open class Foo { + init { + log.append("Foo.;") + } + + companion object { + init { + log.append("Foo.;") + } + } +} + +class Outer { + inner class Inner(val x: Int, val y: Int) : Foo() { + init { + log.append("Inner.;") + } + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/constructorCall/inlineFunInLocalClassConstructorCall.kt b/backend.native/tests/external/codegen/box/constructorCall/inlineFunInLocalClassConstructorCall.kt new file mode 100644 index 00000000000..7061885f7aa --- /dev/null +++ b/backend.native/tests/external/codegen/box/constructorCall/inlineFunInLocalClassConstructorCall.kt @@ -0,0 +1,41 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +fun box(): String { + class Local(val i: Int, val j: Int) : Foo() { + init { + log.append("Local.;") + } + } + + Local( + logged("i;", 1.let { it }), + logged("j;", 2.let { it }) + ) + + val result = log.toString() + if (result != "Foo.;i;j;Foo.;Local.;") return "Fail: '$result'" + + return "OK" +} + +// FILE: util.kt +val log = StringBuilder() + +fun logged(msg: String, value: T): T { + log.append(msg) + return value +} + +// FILE: Foo.kt +open class Foo { + init { + log.append("Foo.;") + } + + companion object { + init { + log.append("Foo.;") + } + } +} diff --git a/backend.native/tests/external/codegen/box/constructorCall/nestedConstructorCallWithJumpOutInConstructorArguments.kt b/backend.native/tests/external/codegen/box/constructorCall/nestedConstructorCallWithJumpOutInConstructorArguments.kt new file mode 100644 index 00000000000..151cc983141 --- /dev/null +++ b/backend.native/tests/external/codegen/box/constructorCall/nestedConstructorCallWithJumpOutInConstructorArguments.kt @@ -0,0 +1,36 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +fun box(): String { + for (count in 0..3) { + val test = Foo(count, Foo(1, "x", 2), if (count > 0) break else 3) + if (count > 0) return "Fail: count = $count" + if (test.toString() != "Foo(0,Foo(1,x,2),3)") return "Fail: ${test.toString()}" + } + + return "OK" +} + + +// FILE: util.kt +val log = StringBuilder() + +fun logged(msg: String, value: T): T { + log.append(msg) + return value +} + +// FILE: Foo.kt +class Foo(val a: Int, val b: Any, val c: Int) { + init { + log.append("") + } + + override fun toString() = "Foo($a,$b,$c)" + + companion object { + init { + log.append("") + } + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/constructorCall/nonLocalReturnInConstructorArguments.kt b/backend.native/tests/external/codegen/box/constructorCall/nonLocalReturnInConstructorArguments.kt new file mode 100644 index 00000000000..a70e2a8a4ec --- /dev/null +++ b/backend.native/tests/external/codegen/box/constructorCall/nonLocalReturnInConstructorArguments.kt @@ -0,0 +1,43 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +fun box(): String { + run L1@{ + var count = 0 + run { + while (true) { + Foo( + logged("i", if (count == 0) 1 else return@L1), + logged("j", 2) + ) + count++ + } + } + } + + val result = log.toString() + if (result != "ij") return "Fail: '$result'" + + return "OK" +} + +// FILE: util.kt +val log = StringBuilder() + +fun logged(msg: String, value: T): T { + log.append(msg) + return value +} + +// FILE: Foo.kt +class Foo(i: Int, j: Int) { + init { + log.append("") + } + + companion object { + init { + log.append("") + } + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/constructorCall/possiblyPoppedUnitializedValueInArguments.kt b/backend.native/tests/external/codegen/box/constructorCall/possiblyPoppedUnitializedValueInArguments.kt new file mode 100644 index 00000000000..d889fb109ff --- /dev/null +++ b/backend.native/tests/external/codegen/box/constructorCall/possiblyPoppedUnitializedValueInArguments.kt @@ -0,0 +1,36 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +fun box(): String { + for (count in 0..3) { + val test = Foo(count, Foo(1, "x", if (count > 0) break else 2), 3) + if (count > 0) return "Fail: count = $count" + if (test.toString() != "Foo(0,Foo(1,x,2),3)") return "Fail: ${test.toString()}" + } + + return "OK" +} + + +// FILE: util.kt +val log = StringBuilder() + +fun logged(msg: String, value: T): T { + log.append(msg) + return value +} + +// FILE: Foo.kt +class Foo(val a: Int, val b: Any, val c: Int) { + init { + log.append("") + } + + override fun toString() = "Foo($a,$b,$c)" + + companion object { + init { + log.append("") + } + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/constructorCall/regularConstructorCallEvaluationOrder.kt b/backend.native/tests/external/codegen/box/constructorCall/regularConstructorCallEvaluationOrder.kt new file mode 100644 index 00000000000..dcba51be98f --- /dev/null +++ b/backend.native/tests/external/codegen/box/constructorCall/regularConstructorCallEvaluationOrder.kt @@ -0,0 +1,32 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +fun box(): String { + Foo(logged("i", 1), logged("j", 2)) + + val result = log.toString() + if (result != "ij") return "Fail: '$result'" + + return "OK" +} + +// FILE: util.kt +val log = StringBuilder() + +fun logged(msg: String, value: T): T { + log.append(msg) + return value +} + +// FILE: Foo.kt +class Foo(i: Int, j: Int) { + init { + log.append("") + } + + companion object { + init { + log.append("") + } + } +} diff --git a/backend.native/tests/external/codegen/box/constructorCall/tryCatchInConstructorCallEvaluationOrder.kt b/backend.native/tests/external/codegen/box/constructorCall/tryCatchInConstructorCallEvaluationOrder.kt new file mode 100644 index 00000000000..4e3e586d5c4 --- /dev/null +++ b/backend.native/tests/external/codegen/box/constructorCall/tryCatchInConstructorCallEvaluationOrder.kt @@ -0,0 +1,35 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +fun box(): String { + Foo( + logged("i", try { 1 } catch (e: Exception) { 42 }), + logged("j", 2) + ) + + val result = log.toString() + if (result != "ij") return "Fail: '$result'" + + return "OK" +} + +// FILE: util.kt +val log = StringBuilder() + +fun logged(msg: String, value: T): T { + log.append(msg) + return value +} + +// FILE: Foo.kt +class Foo(i: Int, j: Int) { + init { + log.append("") + } + + companion object { + init { + log.append("") + } + } +} diff --git a/backend.native/tests/external/codegen/box/controlStructures/parameterWithNameForFunctionType.kt b/backend.native/tests/external/codegen/box/controlStructures/parameterWithNameForFunctionType.kt new file mode 100644 index 00000000000..3796119d725 --- /dev/null +++ b/backend.native/tests/external/codegen/box/controlStructures/parameterWithNameForFunctionType.kt @@ -0,0 +1,8 @@ +fun test(a: T, b: T, operation: (x: T) -> T) { + operation(if (3 > 2) a else b) +} + +fun box(): String { + test(1, 1, { it }) + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/controlStructures/tryCatchInExpressions/tryCatchAfterWhileTrue.kt b/backend.native/tests/external/codegen/box/controlStructures/tryCatchInExpressions/tryCatchAfterWhileTrue.kt new file mode 100644 index 00000000000..4db8ad73a72 --- /dev/null +++ b/backend.native/tests/external/codegen/box/controlStructures/tryCatchInExpressions/tryCatchAfterWhileTrue.kt @@ -0,0 +1,18 @@ +// WITH_RUNTIME +fun box(): String { + val a = arrayListOf() + + while (true) { + if (a.size == 0) { + break + } + } + + for (i in 1..2) { + a.add(try { foo() } catch (e: Throwable) { "OK" }) + } + + return a[0] +} + +fun foo(): String = throw RuntimeException() diff --git a/backend.native/tests/external/codegen/box/coroutines/asyncIteratorNullMerge.kt b/backend.native/tests/external/codegen/box/coroutines/asyncIteratorNullMerge.kt new file mode 100644 index 00000000000..19dd1927514 --- /dev/null +++ b/backend.native/tests/external/codegen/box/coroutines/asyncIteratorNullMerge.kt @@ -0,0 +1,136 @@ +// WITH_RUNTIME +// WITH_COROUTINES +import helpers.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +interface AsyncGenerator { + suspend fun yield(value: T) +} + +interface AsyncSequence { + operator fun iterator(): AsyncIterator +} + +interface AsyncIterator { + operator suspend fun hasNext(): Boolean + operator suspend fun next(): T +} + +fun asyncGenerate(block: suspend AsyncGenerator.() -> Unit): AsyncSequence = object : AsyncSequence { + override fun iterator(): AsyncIterator { + val iterator = AsyncGeneratorIterator() + iterator.nextStep = block.createCoroutine(receiver = iterator, completion = iterator) + return iterator + } +} + +class AsyncGeneratorIterator: AsyncIterator, AsyncGenerator, Continuation { + var computedNext = false + var nextValue: T? = null + var nextStep: Continuation? = null + + // if (computesNext) computeContinuation is Continuation + // if (!computesNext) computeContinuation is Continuation + var computesNext = false + var computeContinuation: Continuation<*>? = null + + override val context = EmptyCoroutineContext + + suspend fun computeHasNext(): Boolean = suspendCoroutineOrReturn { c -> + computesNext = false + computeContinuation = c + nextStep!!.resume(Unit) + COROUTINE_SUSPENDED + } + + suspend fun computeNext(): T = suspendCoroutineOrReturn { c -> + computesNext = true + computeContinuation = c + nextStep!!.resume(Unit) + COROUTINE_SUSPENDED + } + + @Suppress("UNCHECKED_CAST") + fun resumeIterator(exception: Throwable?) { + if (exception != null) { + done() + computeContinuation!!.resumeWithException(exception) + return + } + if (computesNext) { + computedNext = false + (computeContinuation as Continuation).resume(nextValue as T) + } else { + (computeContinuation as Continuation).resume(nextStep != null) + } + } + + override suspend fun hasNext(): Boolean { + if (!computedNext) return computeHasNext() + return nextStep != null + } + + override suspend fun next(): T { + if (!computedNext) return computeNext() + computedNext = false + return nextValue as T + } + + private fun done() { + computedNext = true + nextStep = null + } + + // Completion continuation implementation + override fun resume(value: Unit) { + done() + resumeIterator(null) + } + + override fun resumeWithException(exception: Throwable) { + done() + resumeIterator(exception) + } + + // Generator implementation + override suspend fun yield(value: T): Unit = suspendCoroutineOrReturn { c -> + computedNext = true + nextValue = value + nextStep = c + resumeIterator(null) + COROUTINE_SUSPENDED + } +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun cst(a: Any?): String? = a as String? +fun any(a: Any?): Any? = a + +fun box(): String { + val seq = asyncGenerate { + yield("O") + yield("K") + } + + var res = "" + + builder { + // type of `prev` should be j/l/Object everywhere (even in a expected type position) + var prev: Any? = null + for (i in seq) { + res += i + prev = any(res) + // merge of NULL_VALUE and j/l/Object should result in common j/l/Object value + // but it was NULL_VALUE and we do not spill null values, we just put + // ACONST_NULL after suspension point instead + } + + res = cst(prev) ?: "fail 1" + } + + return res +} diff --git a/backend.native/tests/external/codegen/box/coroutines/controlFlow/forWithStep.kt b/backend.native/tests/external/codegen/box/coroutines/controlFlow/forWithStep.kt new file mode 100644 index 00000000000..43279828a11 --- /dev/null +++ b/backend.native/tests/external/codegen/box/coroutines/controlFlow/forWithStep.kt @@ -0,0 +1,35 @@ +// WITH_RUNTIME +// WITH_COROUTINES +import helpers.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + + +class Controller { + var result = "" + + suspend fun suspendWithResult(value: T): T = suspendCoroutineOrReturn { c -> + c.resume(value) + COROUTINE_SUSPENDED + } +} + +fun builder(c: suspend Controller.() -> Unit): String { + val controller = Controller() + c.startCoroutine(controller, EmptyContinuation) + return controller.result +} + +fun box(): String { + val value = builder { + for (x: Long in 20L..30L step 5L) { + listOf("#").forEach { + result += it + suspendWithResult(x).toString() + } + } + result += "." + } + if (value != "#20#25#30.") return "fail: suspend in for body: $value" + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/coroutines/coroutineToString.kt b/backend.native/tests/external/codegen/box/coroutines/coroutineToString.kt new file mode 100644 index 00000000000..fd02bebdc86 --- /dev/null +++ b/backend.native/tests/external/codegen/box/coroutines/coroutineToString.kt @@ -0,0 +1,33 @@ +// TARGET_BACKEND: JVM +// WITH_REFLECT +// WITH_COROUTINES + +import helpers.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +class A { + suspend fun foo() {} + + suspend fun bar(): T { + foo() + return suspendCoroutineOrReturn { x -> + x.resume(x.toString() as T) + COROUTINE_SUSPENDED + } + } +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + var result = "" + + builder { + result = A().bar() + } + + return if (result == "(kotlin.coroutines.experimental.Continuation) -> kotlin.Any?") "OK" else "Fail: $result" +} diff --git a/backend.native/tests/external/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt b/backend.native/tests/external/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt new file mode 100644 index 00000000000..52453e44edd --- /dev/null +++ b/backend.native/tests/external/codegen/box/coroutines/featureIntersection/breakWithNonEmptyStack.kt @@ -0,0 +1,40 @@ +// WITH_RUNTIME +// WITH_COROUTINES +// IGNORE_BACKEND: NATIVE +import helpers.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +class A { + var result = mutableListOf("O", "K", null) + suspend fun foo(): String? = suspendCoroutineOrReturn { x -> + x.resume(result.removeAt(0)) + COROUTINE_SUSPENDED + } +} + +var result = "" + +suspend fun append(ignore: String, x: String) { + result += x +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +suspend fun bar() { + val a = A() + while (true) { + append("ignore", a.foo() ?: break) + } +} + +fun box(): String { + builder { + bar() + } + + return result +} + diff --git a/backend.native/tests/external/codegen/box/coroutines/inlineFunInGenericClass.kt b/backend.native/tests/external/codegen/box/coroutines/inlineFunInGenericClass.kt new file mode 100644 index 00000000000..4eee3b4e2ac --- /dev/null +++ b/backend.native/tests/external/codegen/box/coroutines/inlineFunInGenericClass.kt @@ -0,0 +1,31 @@ +// WITH_RUNTIME +// WITH_COROUTINES +import helpers.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +suspend fun suspendThere(v: Any?): String = suspendCoroutineOrReturn { x -> + x.resume(v?.toString() ?: "") + COROUTINE_SUSPENDED +} + + +class A(val arg: T) { + var result = "" + inline suspend fun foo() { + result = suspendThere(arg) + } +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + val a = A("OK") + builder { + a.foo() + } + + return a.result +} diff --git a/backend.native/tests/external/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt b/backend.native/tests/external/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt new file mode 100644 index 00000000000..e8ebf741eef --- /dev/null +++ b/backend.native/tests/external/codegen/box/coroutines/inlineGenericFunCalledFromSubclass.kt @@ -0,0 +1,39 @@ +// WITH_RUNTIME +// WITH_COROUTINES +// WITH_REFLECT +import helpers.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> + x.resume(v) + COROUTINE_SUSPENDED +} + +suspend fun foo(x: suspend () -> String): String = x() + +abstract class A { + inline suspend fun baz(): String { + return foo { + suspendThere(T::class.simpleName!!) + } + } + +} +class B : A() { + suspend fun bar(): String { + return baz() + } +} +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} +class OK +fun box(): String { + var result = "fail" + builder { + result = B().bar() + } + + return result +} diff --git a/backend.native/tests/external/codegen/box/coroutines/longRangeInSuspendCall.kt b/backend.native/tests/external/codegen/box/coroutines/longRangeInSuspendCall.kt new file mode 100644 index 00000000000..48a506eb0a2 --- /dev/null +++ b/backend.native/tests/external/codegen/box/coroutines/longRangeInSuspendCall.kt @@ -0,0 +1,31 @@ +// WITH_RUNTIME +// WITH_COROUTINES +import helpers.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +suspend fun getLong(): Long = suspendCoroutineOrReturn { x -> + x.resume(1234567890123L) + COROUTINE_SUSPENDED +} + +suspend fun suspendHere(r: LongRange): Long = suspendCoroutineOrReturn { x -> + x.resume(r.start + r.endInclusive) + COROUTINE_SUSPENDED +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + var result = 0L + + builder { + result = suspendHere(1L..getLong()) + } + + if (result != 1234567890124L) return "fail 1: $result" + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/coroutines/longRangeInSuspendFun.kt b/backend.native/tests/external/codegen/box/coroutines/longRangeInSuspendFun.kt new file mode 100644 index 00000000000..6570d321cb9 --- /dev/null +++ b/backend.native/tests/external/codegen/box/coroutines/longRangeInSuspendFun.kt @@ -0,0 +1,26 @@ +// WITH_RUNTIME +// WITH_COROUTINES +import helpers.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +suspend fun suspendHere(r: LongRange): Long = suspendCoroutineOrReturn { x -> + x.resume(r.start + r.endInclusive) + COROUTINE_SUSPENDED +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + var result = 0L + + builder { + result = suspendHere(1L..1234567890123L) + } + + if (result != 1234567890124L) return "fail 1: $result" + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/coroutines/multiModule/inlineMultiModule.kt b/backend.native/tests/external/codegen/box/coroutines/multiModule/inlineMultiModule.kt new file mode 100644 index 00000000000..ad5db0563d9 --- /dev/null +++ b/backend.native/tests/external/codegen/box/coroutines/multiModule/inlineMultiModule.kt @@ -0,0 +1,69 @@ +// IGNORE_BACKEND: NATIVE +// WITH_COROUTINES +// WITH_RUNTIME + +// MODULE: lib(support) +// FILE: lib.kt + +import helpers.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +var continuation: () -> Unit = { } +var log = "" +var finished = false + +suspend fun foo(v: T): T = suspendCoroutineOrReturn { x -> + continuation = { + x.resume(v) + } + log += "foo($v);" + COROUTINE_SUSPENDED +} + +inline suspend fun bar(v: String) { + log += "before bar($v);" + foo("1:$v") + log += "inside bar($v);" + foo("2:$v") + log += "after bar($v);" +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(handleResultContinuation { + continuation = { } + finished = true + }) +} + +// MODULE: main(lib) +// FILE: main.kt + +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +suspend fun baz() { + bar("A") + log += "between bar;" + bar("B") +} + +val expectedString = + "before bar(A);foo(1:A);@;inside bar(A);foo(2:A);@;after bar(A);" + + "between bar;" + + "before bar(B);foo(1:B);@;inside bar(B);foo(2:B);@;after bar(B);" + +fun box(): String { + builder { + baz() + } + + while (!finished) { + log += "@;" + continuation() + } + + if (log != expectedString) return "fail: $log" + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt b/backend.native/tests/external/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt new file mode 100644 index 00000000000..bc9a47a50f5 --- /dev/null +++ b/backend.native/tests/external/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt @@ -0,0 +1,80 @@ +// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: JVM +// WITH_COROUTINES +// WITH_RUNTIME + +// MODULE: lib(support) +// FILE: lib.kt + +import helpers.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +var continuation: () -> Unit = { } +var log = "" +var finished = false + +suspend fun foo(v: T): T = suspendCoroutineOrReturn { x -> + continuation = { + x.resume(v) + } + log += "foo($v);" + COROUTINE_SUSPENDED +} + +interface I { + suspend fun bar() +} + +class A(val v: String) : I { + override inline suspend fun bar() { + log += "before bar($v);" + foo("1:$v") + log += "inside bar($v);" + foo("2:$v") + log += "after bar($v);" + } +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(handleResultContinuation { + continuation = { } + finished = true + }) +} + +// MODULE: main(lib) +// FILE: main.kt + +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +suspend fun baz() { + val a = A("A") + a.bar() + + log += "between bar;" + + val b: I = A("B") + b.bar() +} + +val expectedString = + "before bar(A);foo(1:A);@;inside bar(A);foo(2:A);@;after bar(A);" + + "between bar;" + + "before bar(B);foo(1:B);@;inside bar(B);foo(2:B);@;after bar(B);" + +fun box(): String { + builder { + baz() + } + + while (!finished) { + log += "@;" + continuation() + } + + if (log != expectedString) return "fail: $log" + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt b/backend.native/tests/external/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt new file mode 100644 index 00000000000..902ef8e991f --- /dev/null +++ b/backend.native/tests/external/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt @@ -0,0 +1,77 @@ +// IGNORE_BACKEND: NATIVE +// WITH_COROUTINES +// WITH_RUNTIME + +// MODULE: lib(support) +// FILE: lib.kt + +import helpers.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +var continuation: () -> Unit = { } +var log = "" +var finished = false + +class C { + var v: String = "" + + inline suspend fun bar() { + log += "before bar($v);" + foo("1:$v") + log += "inside bar($v);" + foo("2:$v") + log += "after bar($v);" + } +} + +suspend fun foo(v: T): T = suspendCoroutineOrReturn { x -> + continuation = { + x.resume(v) + } + log += "foo($v);" + COROUTINE_SUSPENDED +} + +fun C.builder(c: suspend C.() -> Unit) { + c.startCoroutine(this, handleResultContinuation { + continuation = { } + finished = true + }) +} + +// MODULE: main(lib) +// FILE: main.kt + +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +suspend fun C.baz() { + v = "A" + bar() + log += "between bar;" + v = "B" + bar() +} + +val expectedString = + "before bar(A);foo(1:A);@;inside bar(A);foo(2:A);@;after bar(A);" + + "between bar;" + + "before bar(B);foo(1:B);@;inside bar(B);foo(2:B);@;after bar(B);" + +fun box(): String { + var c = C() + + c.builder { + baz() + } + + while (!finished) { + log += "@;" + continuation() + } + + if (log != expectedString) return "fail: $log" + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt b/backend.native/tests/external/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt new file mode 100644 index 00000000000..0d22667d747 --- /dev/null +++ b/backend.native/tests/external/codegen/box/coroutines/suspendFunctionAsCoroutine/openFunWithJava.kt @@ -0,0 +1,60 @@ +// WITH_RUNTIME +// WITH_COROUTINES +// FILE: main.kt +// TARGET_BACKEND: JVM +import helpers.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + + + +open class A(val v: String) { + suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> + x.resume(v) + COROUTINE_SUSPENDED + } + + open suspend fun suspendHere(): String = suspendThere("O") + suspendThere(v) +} + +class B(v: String) : A(v) { + override suspend fun suspendHere(): String = super.suspendHere() + suspendThere("56") +} + +fun builder(c: suspend A.() -> Unit) { + c.startCoroutine(B("K"), EmptyContinuation) +} + +fun box(): String { + var result = JavaClass.foo() + + if (result != "OK56") return "fail 1: $result" + + return "OK" +} + +// FILE: JavaClass.java +import kotlin.coroutines.experimental.*; +public class JavaClass { + public static String foo() { + final String[] res = new String[1]; + + new B("K").suspendHere(new Continuation() { + @Override + public CoroutineContext getContext() { + return EmptyCoroutineContext.INSTANCE; + } + + @Override + public void resume(String s) { + res[0] = s; + } + + @Override + public void resumeWithException(Throwable throwable) { + } + }); + + return res[0]; + } +} diff --git a/backend.native/tests/external/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt b/backend.native/tests/external/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt new file mode 100644 index 00000000000..49a322a5136 --- /dev/null +++ b/backend.native/tests/external/codegen/box/coroutines/suspendFunctionAsCoroutine/superCall.kt @@ -0,0 +1,34 @@ +// WITH_RUNTIME +// WITH_COROUTINES +import helpers.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +open class A(val v: String) { + suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> + x.resume(v) + COROUTINE_SUSPENDED + } + + open suspend fun suspendHere(): String = suspendThere("O") + suspendThere(v) +} + +class B(v: String) : A(v) { + override suspend fun suspendHere(): String = super.suspendHere() + suspendThere("56") +} + +fun builder(c: suspend A.() -> Unit) { + c.startCoroutine(B("K"), EmptyContinuation) +} + +fun box(): String { + var result = "" + + builder { + result = suspendHere() + } + + if (result != "OK56") return "fail 1: $result" + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt b/backend.native/tests/external/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt new file mode 100644 index 00000000000..6763e99ab1f --- /dev/null +++ b/backend.native/tests/external/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallAbstractClass.kt @@ -0,0 +1,41 @@ +// WITH_RUNTIME +// WITH_COROUTINES +import helpers.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +abstract class A(val v: String) { + suspend abstract fun foo(v: String): String + + suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> + x.resume(v) + COROUTINE_SUSPENDED + } + + open suspend fun suspendHere(): String = foo("O") + suspendThere(v) +} + +class B(v: String) : A(v) { + override suspend fun foo(v: String): String = suspendCoroutineOrReturn { x -> + x.resume(v) + COROUTINE_SUSPENDED + } + + override suspend fun suspendHere(): String = super.suspendHere() + suspendThere("56") +} + +fun builder(c: suspend A.() -> Unit) { + c.startCoroutine(B("K"), EmptyContinuation) +} + +fun box(): String { + var result = "" + + builder { + result = suspendHere() + } + + if (result != "OK56") return "fail 1: $result" + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt b/backend.native/tests/external/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt new file mode 100644 index 00000000000..3913958cdb8 --- /dev/null +++ b/backend.native/tests/external/codegen/box/coroutines/suspendFunctionAsCoroutine/superCallInterface.kt @@ -0,0 +1,38 @@ +// WITH_RUNTIME +// WITH_COROUTINES +import helpers.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +interface A { + val v: String + + suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x -> + x.resume(v) + COROUTINE_SUSPENDED + } + + suspend fun suspendHere(): String = suspendThere("O") + suspendThere(v) +} + +interface A2 : A { + override suspend fun suspendHere(): String = super.suspendHere() + suspendThere("56") +} + +class B(override val v: String) : A2 + +fun builder(c: suspend A.() -> Unit) { + c.startCoroutine(B("K"), EmptyContinuation) +} + +fun box(): String { + var result = "" + + builder { + result = suspendHere() + } + + if (result != "OK56") return "fail 1: $result" + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt b/backend.native/tests/external/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt new file mode 100644 index 00000000000..8e0f4ef2605 --- /dev/null +++ b/backend.native/tests/external/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionEvaluationOrder.kt @@ -0,0 +1,56 @@ +// WITH_RUNTIME +// WITH_COROUTINES +import helpers.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +class Controller { + suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + x.resume("K") + COROUTINE_SUSPENDED + } +} + +fun builder(c: suspend Controller.() -> Unit) { + c.startCoroutine(Controller(), EmptyContinuation) +} + +val logger = StringBuilder() + +class A(val first: String, val second: String) { + init { + logger.append("A.;") + } + + override fun toString() = "$first$second" + + companion object { + init { + logger.append("A.;") + } + } +} + +inline fun logged(message: String, result: () -> T): T { + logger.append(message) + return result() +} + +fun box(): String { + var result = "OK" + + builder { + var local: Any = A(logged("args;") { "O" }, suspendHere()) + + if (local.toString() != "OK") { + result = "fail 1: $local" + return@builder + } + } + + if (logger.toString() != "args;A.;A.;") { + return "Fail: '$logger'" + } + + return result +} diff --git a/backend.native/tests/external/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt b/backend.native/tests/external/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt new file mode 100644 index 00000000000..d68f224d6ce --- /dev/null +++ b/backend.native/tests/external/codegen/box/coroutines/suspendInTheMiddleOfObjectConstructionWithJumpOut.kt @@ -0,0 +1,152 @@ +// WITH_RUNTIME +// WITH_COROUTINES +import helpers.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +class Controller { + suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + x.resume("K") + COROUTINE_SUSPENDED + } + + suspend fun suspendWithArgument(v: String): String = suspendCoroutineOrReturn { x -> + x.resume(v) + COROUTINE_SUSPENDED + } + + suspend fun suspendWithDouble(v: Double): Double = suspendCoroutineOrReturn { x -> + x.resume(v) + COROUTINE_SUSPENDED + } +} + +fun builder(c: suspend Controller.() -> Unit) { + c.startCoroutine(Controller(), EmptyContinuation) +} + +class A(val first: String, val second: String) { + override fun toString() = "$first$second" +} + +class B(val first: String, val second: String, val third: String) { + override fun toString() = "$first$second$third" +} + +class C(val a: Long, val b: Double, val c: Int, val d: String) { + override fun toString() = "$a#$b#$c#$d" +} + +val condition = true + +fun box(): String { + var result = "OK" + + builder { + for (count in 0..3) { + val local = A(if (count > 0) break else "O", suspendHere()) + + if (count > 0) { + result = "fail 1: count=$count" + return@builder + } + + if (local.toString() != "OK") { + result = "fail 1: $local" + return@builder + } + } + + for (count in 0..3) { + val local = B(if (count > 0) break else "#", suspendWithArgument("O"), suspendHere()) + + if (count > 0) { + result = "fail 2: count=$count" + return@builder + } + + if (local.toString() != "#OK") { + result = "fail 2: $local" + return@builder + } + } + + for (count in 0..3) { + val local = B(suspendWithArgument("#"), if (count > 0) break else "O", suspendHere()) + + if (count > 0) { + result = "fail 3: count=$count" + return@builder + } + + if (local.toString() != "#OK") { + result = "fail 3: $local" + return@builder + } + } + + for (count in 0..3) { + val local = B( + "#", + B("", + if (count > 0) break else "O", + suspendWithArgument("") + ).toString(), + suspendHere() + ) + + if (count > 0) { + result = "fail 4: count=$count" + return@builder + } + + if (local.toString() != "#OK") { + result = "fail 4: $local" + return@builder + } + } + + loop@for (count in 0..3) { + val local = B( + if (!condition) "1" else suspendWithArgument("#"), + when { + count > 0 -> break@loop + condition -> suspendWithArgument("O") + else -> "2" + }, + if (condition) suspendHere() else suspendWithArgument("3") + ) + + if (count > 0) { + result = "fail 5: count=$count" + return@builder + } + + if (local.toString() != "#OK") { + result = "fail 5: $local" + return@builder + } + } + + for (count in 0..3) { + val local = C( + 1234567890123L, + suspendWithDouble(3.14), + 42, + if (count > 0) break else suspendWithArgument("OK") + ) + + if (count > 0) { + result = "fail 6: count=$count" + return@builder + } + + if (local.toString() != "1234567890123#3.14#42#OK") { + result = "fail 6: $local" + return@builder + } + } + } + + return result +} diff --git a/backend.native/tests/external/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt b/backend.native/tests/external/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt index 4b1dbf6ddcc..a56b3e5e4ed 100644 --- a/backend.native/tests/external/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt +++ b/backend.native/tests/external/codegen/box/coroutines/unitTypeReturn/suspendNonLocalReturn.kt @@ -1,6 +1,5 @@ // WITH_RUNTIME // WITH_COROUTINES -// IGNORE_BACKEND: JS import helpers.* import kotlin.coroutines.experimental.* import kotlin.coroutines.experimental.intrinsics.* diff --git a/backend.native/tests/external/codegen/box/coroutines/varSpilling/kt19475.kt b/backend.native/tests/external/codegen/box/coroutines/varSpilling/kt19475.kt new file mode 100644 index 00000000000..b18b763100d --- /dev/null +++ b/backend.native/tests/external/codegen/box/coroutines/varSpilling/kt19475.kt @@ -0,0 +1,32 @@ +// WITH_RUNTIME +// WITH_COROUTINES +import helpers.* +import kotlin.coroutines.experimental.* +import kotlin.coroutines.experimental.intrinsics.* + +suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> + x.resume("OK") + COROUTINE_SUSPENDED +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + var result = arrayListOf() + + builder { + while (true) { + if (result.size == 0) { + break + } + } + + for (i in 1..2) { + result.add(suspendHere()) + } + } + + return result[0] +} diff --git a/backend.native/tests/external/codegen/box/dataClasses/copy/kt12708.kt b/backend.native/tests/external/codegen/box/dataClasses/copy/kt12708.kt index f2ac4b4e0af..e3c5e6485b9 100644 --- a/backend.native/tests/external/codegen/box/dataClasses/copy/kt12708.kt +++ b/backend.native/tests/external/codegen/box/dataClasses/copy/kt12708.kt @@ -1,3 +1,5 @@ +// LANGUAGE_VERSION: 1.1 + fun box(): String { val a: A = B(1) a.copy(1) diff --git a/backend.native/tests/external/codegen/box/defaultArguments/implementedByFake.kt b/backend.native/tests/external/codegen/box/defaultArguments/implementedByFake.kt index d5c4564cbac..b29a016f166 100644 --- a/backend.native/tests/external/codegen/box/defaultArguments/implementedByFake.kt +++ b/backend.native/tests/external/codegen/box/defaultArguments/implementedByFake.kt @@ -1,6 +1,4 @@ -// TARGET_BACKEND: JS -// This test causes JVM to generate incorrect bytecode -// Could not use IGNORE_BACKEND directive, since it makes LightAnalysisModeCodegenTestsGenerated fail on this test +// IGNORE_BACKEND: JVM interface I { val prop: T diff --git a/backend.native/tests/external/codegen/box/defaultArguments/inheritedFromInterfaceViaAbstractSuperclass.kt b/backend.native/tests/external/codegen/box/defaultArguments/inheritedFromInterfaceViaAbstractSuperclass.kt new file mode 100644 index 00000000000..b74007df30e --- /dev/null +++ b/backend.native/tests/external/codegen/box/defaultArguments/inheritedFromInterfaceViaAbstractSuperclass.kt @@ -0,0 +1,17 @@ +interface I { + fun foo(x: Int = 23): String +} + +abstract class Base : I + +class C : Base(), I { + override fun foo(x: Int) = "C:$x" +} + +fun box(): String { + val x: I = C() + val r = x.foo() + ";" + x.foo(42) + if (r != "C:23;C:42") return "fail: $r" + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/delegatedProperty/genericDelegateUncheckedCast1.kt b/backend.native/tests/external/codegen/box/delegatedProperty/genericDelegateUncheckedCast1.kt new file mode 100644 index 00000000000..e122e11cd6e --- /dev/null +++ b/backend.native/tests/external/codegen/box/delegatedProperty/genericDelegateUncheckedCast1.kt @@ -0,0 +1,38 @@ +// IGNORE_BACKEND: JS + +import kotlin.reflect.KProperty + +class Delegate(var inner: T) { + operator fun getValue(t: Any?, p: KProperty<*>): T = inner + operator fun setValue(t: Any?, p: KProperty<*>, i: T) { inner = i } +} + +val del = Delegate("zzz") + +class A { + inner class B { + var prop: String by del + } +} + +inline fun asFailsWithCCE(block: () -> Unit) { + try { + block() + } + catch (e: ClassCastException) { + return + } + catch (e: Throwable) { + throw AssertionError("Should throw ClassCastException, got $e") + } + throw AssertionError("Should throw ClassCastException, no exception thrown") +} + +fun box(): String { + val c = A().B() + + (del as Delegate).inner = 10 + asFailsWithCCE { c.prop } // does not fail in JS due KT-8135. + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/delegatedProperty/genericDelegateUncheckedCast2.kt b/backend.native/tests/external/codegen/box/delegatedProperty/genericDelegateUncheckedCast2.kt new file mode 100644 index 00000000000..14e4970fa59 --- /dev/null +++ b/backend.native/tests/external/codegen/box/delegatedProperty/genericDelegateUncheckedCast2.kt @@ -0,0 +1,38 @@ +// IGNORE_BACKEND: JVM, JS + +import kotlin.reflect.KProperty + +class Delegate(var inner: T) { + operator fun getValue(t: Any?, p: KProperty<*>): T = inner + operator fun setValue(t: Any?, p: KProperty<*>, i: T) { inner = i } +} + +val del = Delegate("zzz") + +class A { + inner class B { + var prop: String by del + } +} + +inline fun asFailsWithCCE(block: () -> Unit) { + try { + block() + } + catch (e: ClassCastException) { + return + } + catch (e: Throwable) { + throw AssertionError("Should throw ClassCastException, got $e") + } + throw AssertionError("Should throw ClassCastException, no exception thrown") +} + +fun box(): String { + val c = A().B() + + (del as Delegate).inner = null + asFailsWithCCE { c.prop } // does not fail in JVM, JS due KT-8135. + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/delegatedProperty/genericSetValueViaSyntheticAccessor.kt b/backend.native/tests/external/codegen/box/delegatedProperty/genericSetValueViaSyntheticAccessor.kt new file mode 100644 index 00000000000..cfcaceb9ebc --- /dev/null +++ b/backend.native/tests/external/codegen/box/delegatedProperty/genericSetValueViaSyntheticAccessor.kt @@ -0,0 +1,25 @@ +// FILE: Var.kt +package pvar + +open class PVar(private var value: T) { + protected operator fun getValue(thisRef: Any?, prop: Any?) = value + + protected operator fun setValue(thisRef: Any?, prop: Any?, newValue: T) { + value = newValue + } +} + +// FILE: test.kt +import pvar.* + +class C : PVar(42L) { + inner class Inner { + var x by this@C + } +} + +fun box(): String { + val inner = C().Inner() + inner.x = 1L + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/delegatedProperty/local/kt16864.kt b/backend.native/tests/external/codegen/box/delegatedProperty/local/kt16864.kt new file mode 100644 index 00000000000..99b3011a5c4 --- /dev/null +++ b/backend.native/tests/external/codegen/box/delegatedProperty/local/kt16864.kt @@ -0,0 +1,13 @@ + +object Whatever { + operator fun getValue(thisRef: Any?, prop: Any?) = "OK" +} + +fun box(): String { + val key by Whatever + return { + object { + val keys = key + }.keys + } () +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/delegatedProperty/local/kt19690.kt b/backend.native/tests/external/codegen/box/delegatedProperty/local/kt19690.kt new file mode 100644 index 00000000000..03821c10db8 --- /dev/null +++ b/backend.native/tests/external/codegen/box/delegatedProperty/local/kt19690.kt @@ -0,0 +1,17 @@ +//WITH_REFLECT + +import kotlin.properties.Delegates + +interface MyInterface { + fun something(): String { + var foo: String by Delegates.notNull(); + foo = "OK" + return foo + } +} + +fun box(): String { + return object : MyInterface { + + }.something() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/delegatedProperty/privateSetterKPropertyIsNotMutable.kt b/backend.native/tests/external/codegen/box/delegatedProperty/privateSetterKPropertyIsNotMutable.kt index 24c0e05c6c2..41ac519cecc 100644 --- a/backend.native/tests/external/codegen/box/delegatedProperty/privateSetterKPropertyIsNotMutable.kt +++ b/backend.native/tests/external/codegen/box/delegatedProperty/privateSetterKPropertyIsNotMutable.kt @@ -3,7 +3,10 @@ // WITH_REFLECT -import kotlin.reflect.* +import kotlin.reflect.KProperty +import kotlin.reflect.KMutableProperty +import kotlin.reflect.KMutableProperty1 +import kotlin.reflect.full.* import kotlin.reflect.jvm.* object Delegate { diff --git a/backend.native/tests/external/codegen/box/delegatedProperty/provideDelegate/generic.kt b/backend.native/tests/external/codegen/box/delegatedProperty/provideDelegate/generic.kt index 8e6af346f90..36ec4bb9508 100644 --- a/backend.native/tests/external/codegen/box/delegatedProperty/provideDelegate/generic.kt +++ b/backend.native/tests/external/codegen/box/delegatedProperty/provideDelegate/generic.kt @@ -10,15 +10,15 @@ open class MyClass(val value: String) { } } -inline fun runLogged(entry: String, action: () -> T): T { +inline fun runLogged(entry: String, action: () -> L): L { log += entry return action() } -operator fun T.provideDelegate(host: Any?, p: Any): T = +operator fun P.provideDelegate(host: Any?, p: Any): P = runLogged("tdf(${this.value});") { this } -operator fun T.getValue(receiver: Any?, p: Any): T = +operator fun V.getValue(receiver: Any?, p: Any): V = runLogged("get($this);") { this } val testO by runLogged("O;") { MyClass("O") } diff --git a/backend.native/tests/external/codegen/box/delegatedProperty/provideDelegate/kt18902.kt b/backend.native/tests/external/codegen/box/delegatedProperty/provideDelegate/kt18902.kt new file mode 100644 index 00000000000..9b20ca39800 --- /dev/null +++ b/backend.native/tests/external/codegen/box/delegatedProperty/provideDelegate/kt18902.kt @@ -0,0 +1,22 @@ +// WITH_RUNTIME + +import kotlin.properties.ReadOnlyProperty +import kotlin.reflect.KProperty + +class Delegate: ReadOnlyProperty { + override fun getValue(thisRef: Test, property: KProperty<*>) = "OK" +} + +class Provider { + operator fun provideDelegate(thisRef: Test, property: KProperty<*>) = Delegate() +} + +class Test { + companion object { + val instance = Test() + } + + val message by Provider() +} + +fun box() = Test.instance.message \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/delegation/withDefaultParameters.kt b/backend.native/tests/external/codegen/box/delegation/withDefaultParameters.kt new file mode 100644 index 00000000000..dd9e8a968f6 --- /dev/null +++ b/backend.native/tests/external/codegen/box/delegation/withDefaultParameters.kt @@ -0,0 +1,60 @@ +// IGNORE_BACKEND: JVM + +var log = "" +fun log(a: String) { + log += a + ";" +} + +interface C { + fun foo(x: Int): Unit { + log("C.foo($x)") + } +} + +interface I { + fun foo(x: Int = 1): Unit +} + +class G(c: C) : C by c, I +class H(c: C) : I, C by c + +fun test1() { + log = "" + + val g1 = G(object: C {}) + g1.foo(2) + g1.foo() + val g2 = G(object: C { + override fun foo(x: Int) { + log("[2] object:C.foo($x)") + } + }) + g2.foo(2) + g2.foo() +} + +fun test2() { + log = "" + + val h1 = H(object: C {}) + h1.foo(2) + h1.foo() + val h2 = H(object: C { + override fun foo(x: Int) { + log("[2] object:C.foo($x)") + } + }) + h2.foo(2) + h2.foo() +} + + +fun box(): String { + test1() + if (log != "C.foo(2);C.foo(1);[2] object:C.foo(2);[2] object:C.foo(1);") return "fail1: $log" + + test2() + if (log != "C.foo(2);C.foo(1);[2] object:C.foo(2);[2] object:C.foo(1);") return "fail2: $log" + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/deepInnerClassInEnumEntryClass.kt b/backend.native/tests/external/codegen/box/enum/deepInnerClassInEnumEntryClass.kt new file mode 100644 index 00000000000..6be3fd7d077 --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/deepInnerClassInEnumEntryClass.kt @@ -0,0 +1,24 @@ +// LANGUAGE_VERSION: 1.2 + +enum class A { + X { + val x = "OK" + + inner class Inner { + inner class Inner2 { + inner class Inner3 { + val y = x + } + } + } + + val z = Inner().Inner2().Inner3() + + override val test: String + get() = z.y + }; + + abstract val test: String +} + +fun box() = A.X.test \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/deepInnerClassInEnumEntryClass2.kt b/backend.native/tests/external/codegen/box/enum/deepInnerClassInEnumEntryClass2.kt new file mode 100644 index 00000000000..63377128f1f --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/deepInnerClassInEnumEntryClass2.kt @@ -0,0 +1,23 @@ +// LANGUAGE_VERSION: 1.2 + +enum class A { + X { + val k = "K" + + val anonObject = object { + inner class Inner { + val x = "O" + k + } + + val innerX = Inner().x + + override fun toString() = innerX + } + + override val test = anonObject.toString() + }; + + abstract val test: String +} + +fun box() = A.X.test \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/enumEntryReferenceFromInnerClassConstructor1.kt b/backend.native/tests/external/codegen/box/enum/enumEntryReferenceFromInnerClassConstructor1.kt new file mode 100644 index 00000000000..135eeffae89 --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/enumEntryReferenceFromInnerClassConstructor1.kt @@ -0,0 +1,24 @@ +interface IFoo { + fun foo(): String +} + +interface IBar { + fun bar(): String +} + +abstract class Base(val x: IFoo) + +enum class Test : IFoo, IBar { + FOO { + // FOO referenced from inner class constructor with uninitialized 'this' + inner class Inner : Base(FOO) + + val z = Inner() + + override fun foo() = "OK" + + override fun bar() = z.x.foo() + } +} + +fun box() = Test.FOO.bar() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/enumEntryReferenceFromInnerClassConstructor2.kt b/backend.native/tests/external/codegen/box/enum/enumEntryReferenceFromInnerClassConstructor2.kt new file mode 100644 index 00000000000..7745c582462 --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/enumEntryReferenceFromInnerClassConstructor2.kt @@ -0,0 +1,24 @@ +interface IFoo { + fun foo(): String +} + +interface IBar { + fun bar(): String +} + +enum class Test : IFoo, IBar { + FOO { + // FOO referenced from inner class constructor with initialized 'this' + inner class Inner { + val fooFoo = FOO.foo() + } + + val z = Inner() + + override fun foo() = "OK" + + override fun bar() = z.fooFoo + } +} + +fun box() = Test.FOO.bar() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/enumEntryReferenceFromInnerClassConstructor3.kt b/backend.native/tests/external/codegen/box/enum/enumEntryReferenceFromInnerClassConstructor3.kt new file mode 100644 index 00000000000..635103b8b02 --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/enumEntryReferenceFromInnerClassConstructor3.kt @@ -0,0 +1,23 @@ +interface IFoo { + fun foo(): String +} + +interface IBar { + fun bar(): String +} + +enum class Test : IFoo, IBar { + FOO { + // FOO referenced from inner class constructor with initialized 'this', + // in delegate initializer + inner class Inner : IFoo by FOO + + val z = Inner() + + override fun foo() = "OK" + + override fun bar() = z.foo() + } +} + +fun box() = Test.FOO.bar() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/innerClassInEnumEntryClass.kt b/backend.native/tests/external/codegen/box/enum/innerClassInEnumEntryClass.kt new file mode 100644 index 00000000000..0dd565a3374 --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/innerClassInEnumEntryClass.kt @@ -0,0 +1,20 @@ +// LANGUAGE_VERSION: 1.2 + +enum class A { + X { + val x = "OK" + + inner class Inner { + val y = x + } + + val z = Inner() + + override val test: String + get() = z.y + }; + + abstract val test: String +} + +fun box() = A.X.test \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/innerClassMethodInEnumEntryClass.kt b/backend.native/tests/external/codegen/box/enum/innerClassMethodInEnumEntryClass.kt new file mode 100644 index 00000000000..ecb03132ed7 --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/innerClassMethodInEnumEntryClass.kt @@ -0,0 +1,19 @@ +// LANGUAGE_VERSION: 1.2 + +enum class A { + X { + val x = "OK" + + inner class Inner { + fun foo() = x + } + + val z = Inner() + + override val test = z.foo() + }; + + abstract val test: String +} + +fun box() = A.X.test \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/innerClassMethodInEnumEntryClass2.kt b/backend.native/tests/external/codegen/box/enum/innerClassMethodInEnumEntryClass2.kt new file mode 100644 index 00000000000..2868f51c1e0 --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/innerClassMethodInEnumEntryClass2.kt @@ -0,0 +1,19 @@ +// LANGUAGE_VERSION: 1.2 + +enum class A { + X { + val x = "OK" + + inner class Inner { + fun foo() = this@X.x + } + + val z = Inner() + + override val test = z.foo() + }; + + abstract val test: String +} + +fun box() = A.X.test \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/kt20651.kt b/backend.native/tests/external/codegen/box/enum/kt20651.kt new file mode 100644 index 00000000000..8845e4c6d48 --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/kt20651.kt @@ -0,0 +1,14 @@ +enum class Test(val x: String, val closure1: () -> String) { + FOO("O", { FOO.x }) { + override val y: String = "K" + val closure2 = { y } // Implicit 'FOO' + override val z: String = closure2() + }; + + abstract val y: String + abstract val z: String + + fun test() = closure1() + z +} + +fun box() = Test.FOO.test() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/kt20651_inlineLambda.kt b/backend.native/tests/external/codegen/box/enum/kt20651_inlineLambda.kt new file mode 100644 index 00000000000..d1f12734575 --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/kt20651_inlineLambda.kt @@ -0,0 +1,14 @@ +enum class Test(val x: String, val closure1: () -> String) { + FOO("O", run { { FOO.x } }) { + override val y: String = "K" + val closure2 = { y } // Implicit 'FOO' + override val z: String = closure2() + }; + + abstract val y: String + abstract val z: String + + fun test() = closure1() + z +} + +fun box() = Test.FOO.test() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/kt20651a.kt b/backend.native/tests/external/codegen/box/enum/kt20651a.kt new file mode 100644 index 00000000000..4bdecd58654 --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/kt20651a.kt @@ -0,0 +1,8 @@ +enum class Foo( + val x: String, + val callback: () -> String +) { + FOO("OK", { FOO.x }) +} + +fun box() = Foo.FOO.callback() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/kt20651b.kt b/backend.native/tests/external/codegen/box/enum/kt20651b.kt new file mode 100644 index 00000000000..477e3036569 --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/kt20651b.kt @@ -0,0 +1,17 @@ +interface Callback { + fun invoke(): String +} + +enum class Foo( + val x: String, + val callback: Callback +) { + FOO( + "OK", + object : Callback { + override fun invoke() = FOO.x + } + ) +} + +fun box() = Foo.FOO.callback.invoke() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/kt7257.kt b/backend.native/tests/external/codegen/box/enum/kt7257.kt new file mode 100644 index 00000000000..78dca7e9610 --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/kt7257.kt @@ -0,0 +1,10 @@ +enum class X { + B { + val value2 = "K" + override val value = "O".let { it + value2 } + }; + + abstract val value: String +} + +fun box() = X.B.value \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/kt7257_anonObjectInit.kt b/backend.native/tests/external/codegen/box/enum/kt7257_anonObjectInit.kt new file mode 100644 index 00000000000..2cc9963d5c6 --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/kt7257_anonObjectInit.kt @@ -0,0 +1,17 @@ +enum class X { + B { + val value2 = "K" + + val anonObject = object { + val value3 = "O" + value2 + + override fun toString(): String = value3 + } + + override val value = anonObject.toString() + }; + + abstract val value: String +} + +fun box() = X.B.value \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/kt7257_anonObjectMethod.kt b/backend.native/tests/external/codegen/box/enum/kt7257_anonObjectMethod.kt new file mode 100644 index 00000000000..4f5e5ce5bda --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/kt7257_anonObjectMethod.kt @@ -0,0 +1,16 @@ +enum class X { + B { + val value2 = "K" + + val anonObject = object { + override fun toString(): String = + "O" + value2 + } + + override val value = anonObject.toString() + }; + + abstract val value: String +} + +fun box() = X.B.value \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/kt7257_boundReference1.kt b/backend.native/tests/external/codegen/box/enum/kt7257_boundReference1.kt new file mode 100644 index 00000000000..8c9f07718e0 --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/kt7257_boundReference1.kt @@ -0,0 +1,21 @@ +// LANGUAGE_VERSION: 1.2 + +enum class X { + B { + val k = "K" + + inner class Inner { + fun foo() = "O" + k + } + + val inner = Inner() + + val bmr = inner::foo + + override val value = bmr.invoke() + }; + + abstract val value: String +} + +fun box() = X.B.value \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/kt7257_boundReference2.kt b/backend.native/tests/external/codegen/box/enum/kt7257_boundReference2.kt new file mode 100644 index 00000000000..e34bc6403ba --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/kt7257_boundReference2.kt @@ -0,0 +1,18 @@ +enum class X { + B { + + override val value = "OK" + + val bmr = B::value.get() + + override fun foo(): String { + return bmr + } + }; + + abstract val value: String + + abstract fun foo(): String +} + +fun box() = X.B.foo() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/kt7257_boundReferenceWithImplicitReceiver.kt b/backend.native/tests/external/codegen/box/enum/kt7257_boundReferenceWithImplicitReceiver.kt new file mode 100644 index 00000000000..0b89217da3e --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/kt7257_boundReferenceWithImplicitReceiver.kt @@ -0,0 +1,15 @@ +// LANGUAGE_VERSION: 1.2 + +enum class X { + B { + override val value = "OK" + + override val test = ::value.get() + }; + + abstract val value: String + + abstract val test: String +} + +fun box() = X.B.test \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/kt7257_explicitReceiver.kt b/backend.native/tests/external/codegen/box/enum/kt7257_explicitReceiver.kt new file mode 100644 index 00000000000..44c3183a50a --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/kt7257_explicitReceiver.kt @@ -0,0 +1,11 @@ +enum class X { + B { + override val value2 = "K" + override val value = "O" + B.value2 + }; + + abstract val value2: String + abstract val value: String +} + +fun box() = X.B.value \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/kt7257_fullyQualifiedReceiver.kt b/backend.native/tests/external/codegen/box/enum/kt7257_fullyQualifiedReceiver.kt new file mode 100644 index 00000000000..384e2daa331 --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/kt7257_fullyQualifiedReceiver.kt @@ -0,0 +1,11 @@ +enum class X { + B { + override val value2 = "K" + override val value = "O" + X.B.value2 + }; + + abstract val value2: String + abstract val value: String +} + +fun box() = X.B.value \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/kt7257_namedLocalFun.kt b/backend.native/tests/external/codegen/box/enum/kt7257_namedLocalFun.kt new file mode 100644 index 00000000000..5438d725fba --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/kt7257_namedLocalFun.kt @@ -0,0 +1,17 @@ +enum class X { + B { + val value2 = "K" + + val value3: String + init { + fun foo() = value2 + value3 = "O" + foo() + } + + override val value = value3 + }; + + abstract val value: String +} + +fun box() = X.B.value \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/enum/kt7257_notInline.kt b/backend.native/tests/external/codegen/box/enum/kt7257_notInline.kt new file mode 100644 index 00000000000..3851efb5669 --- /dev/null +++ b/backend.native/tests/external/codegen/box/enum/kt7257_notInline.kt @@ -0,0 +1,13 @@ +fun T.letNoInline(fn: (T) -> R) = + fn(this) + +enum class X { + B { + val value2 = "K" + override val value = "O".letNoInline { it + value2 } + }; + + abstract val value: String +} + +fun box() = X.B.value \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/fullJdk/classpath.kt b/backend.native/tests/external/codegen/box/fullJdk/classpath.kt deleted file mode 100644 index 6277a2ffc6c..00000000000 --- a/backend.native/tests/external/codegen/box/fullJdk/classpath.kt +++ /dev/null @@ -1,18 +0,0 @@ -// TARGET_BACKEND: JVM - -// FULL_JDK - -import sun.nio.cs.ext.Big5 -import sun.net.spi.nameservice.dns.DNSNameService -import javax.crypto.Cipher -import com.sun.crypto.provider.SunJCE -import sun.nio.ByteBuffered - -fun box(): String { - val a = Big5() // charsets.jar - val c = DNSNameService() // dnsns.ajr - val e : Cipher? = null // jce.jar - val f : SunJCE? = null // sunjce_provider.jar - val j : ByteBuffered? = null // rt.jar - return "OK" -} diff --git a/backend.native/tests/external/codegen/box/functions/functionNtoString.kt b/backend.native/tests/external/codegen/box/functions/functionNtoString.kt index f8c9317abcd..8ec080de4c6 100644 --- a/backend.native/tests/external/codegen/box/functions/functionNtoString.kt +++ b/backend.native/tests/external/codegen/box/functions/functionNtoString.kt @@ -10,14 +10,14 @@ fun check(expected: String, obj: Any?) { } fun box(): String { - check("() -> kotlin.Unit") - { -> } - check("() -> kotlin.Int") - { -> 42 } + check("() -> kotlin.Unit", + { -> }) + check("() -> kotlin.Int", + { -> 42 }) check("(kotlin.String) -> kotlin.Long", fun (s: String) = 42.toLong()) - check("(kotlin.Int, kotlin.Int) -> kotlin.Unit") - { x: Int, y: Int -> } + check("(kotlin.Int, kotlin.Int) -> kotlin.Unit", + { x: Int, y: Int -> }) check("kotlin.Int.() -> kotlin.Unit", fun Int.() {}) diff --git a/backend.native/tests/external/codegen/box/functions/functionNtoStringNoReflect.kt b/backend.native/tests/external/codegen/box/functions/functionNtoStringNoReflect.kt index 86b6223c050..d1ee567b648 100644 --- a/backend.native/tests/external/codegen/box/functions/functionNtoStringNoReflect.kt +++ b/backend.native/tests/external/codegen/box/functions/functionNtoStringNoReflect.kt @@ -8,14 +8,14 @@ fun check(expected: String, obj: Any?) { } fun box(): String { - check("Function0") - { -> } - check("Function0") - { -> 42 } + check("Function0", + { -> }) + check("Function0", + { -> 42 }) check("Function1", fun (s: String) = 42.toLong()) - check("Function2") - { x: Int, y: Int -> } + check("Function2", + { x: Int, y: Int -> }) check("Function1", fun Int.() {}) diff --git a/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/destructuringAssignmentWithNullabilityAssertionOnExtensionReceiver_lv12.kt b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/destructuringAssignmentWithNullabilityAssertionOnExtensionReceiver_lv12.kt new file mode 100644 index 00000000000..52032e8f491 --- /dev/null +++ b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/destructuringAssignmentWithNullabilityAssertionOnExtensionReceiver_lv12.kt @@ -0,0 +1,28 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +// LANGUAGE_VERSION: 1.2 +import kotlin.test.* + +var component1Evaluated = false + +// NB extension receiver is nullable +operator fun J?.component1() = 1.also { component1Evaluated = true } + +private operator fun J.component2() = 2 + +fun use(x: Any) {} + +fun box(): String { + assertFailsWith { + val (a, b) = J.j() + } + if (!component1Evaluated) return "component1 should be evaluated" + return "OK" +} + + +// FILE: J.java +public class J { + public static J j() { return null; } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inFunctionWithExpressionBody.kt b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inFunctionWithExpressionBody.kt new file mode 100644 index 00000000000..f7b2c2654df --- /dev/null +++ b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inFunctionWithExpressionBody.kt @@ -0,0 +1,29 @@ +// TARGET_BACKEND: JVM +// STRICT_JAVA_NULLABILITY_ASSERTIONS + +// FILE: box.kt +fun box(): String { + try { + J().test() + return "Fail: should throw" + } + catch (e: Throwable) { + return "OK" + } +} + +// FILE: test.kt +fun withAssertion(j: J) = j.nullString() + +// FILE: J.java +import org.jetbrains.annotations.NotNull; + +public class J { + public @NotNull String nullString() { + return null; + } + + public void test() { + TestKt.withAssertion(this); + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inFunctionWithExpressionBodyWithJavaGeneric.kt b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inFunctionWithExpressionBodyWithJavaGeneric.kt new file mode 100644 index 00000000000..74e2c3a70bf --- /dev/null +++ b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inFunctionWithExpressionBodyWithJavaGeneric.kt @@ -0,0 +1,34 @@ +// TARGET_BACKEND: JVM +// STRICT_JAVA_NULLABILITY_ASSERTIONS + +// See KT-8135 +// We could generate runtime assertion on call site for 'generic()' below. + +// FILE: box.kt +fun box(): String { + try { + J().test() + return "OK" + } + catch (e: Throwable) { + return "Fail: SHOULD NOT throw" + } +} + +// FILE: test.kt +fun withAssertion(j: J) = generic(j) + +fun generic(j: J) = j.nullT() + +// FILE: J.java +import org.jetbrains.annotations.NotNull; + +public class J { + public @NotNull T nullT() { + return null; + } + + public void test() { + TestKt.withAssertion(this); + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inLocalFunctionWithExpressionBody.kt b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inLocalFunctionWithExpressionBody.kt new file mode 100644 index 00000000000..29dc4850156 --- /dev/null +++ b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inLocalFunctionWithExpressionBody.kt @@ -0,0 +1,28 @@ +// TARGET_BACKEND: JVM +// STRICT_JAVA_NULLABILITY_ASSERTIONS + +// FILE: box.kt +fun box(): String { + try { + outer() + return "Fail: should throw" + } + catch (e: Throwable) { + return "OK" + } +} + +// FILE: test.kt +fun outer() { + fun withAssertion() = J().nullString() + withAssertion() // NB not used itself +} + +// FILE: J.java +import org.jetbrains.annotations.NotNull; + +public class J { + public @NotNull String nullString() { + return null; + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inLocalVariableInitializer.kt b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inLocalVariableInitializer.kt new file mode 100644 index 00000000000..6c2df07de45 --- /dev/null +++ b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inLocalVariableInitializer.kt @@ -0,0 +1,31 @@ +// TARGET_BACKEND: JVM +// STRICT_JAVA_NULLABILITY_ASSERTIONS + +// FILE: box.kt +fun box(): String { + try { + J().test() + return "Fail: should throw" + } + catch (e: Throwable) { + return "OK" + } +} + +// FILE: test.kt +fun withAssertion(j: J) { + val x = j.nullString() +} + +// FILE: J.java +import org.jetbrains.annotations.NotNull; + +public class J { + public @NotNull String nullString() { + return null; + } + + public void test() { + TestKt.withAssertion(this); + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inMemberPropertyInitializer.kt b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inMemberPropertyInitializer.kt new file mode 100644 index 00000000000..38c8d587615 --- /dev/null +++ b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inMemberPropertyInitializer.kt @@ -0,0 +1,31 @@ +// TARGET_BACKEND: JVM +// STRICT_JAVA_NULLABILITY_ASSERTIONS + +// FILE: box.kt +fun box(): String { + try { + J().test() + return "Fail: should throw" + } + catch (e: Throwable) { + return "OK" + } +} + +// FILE: test.kt +class C { + val withAssertion = J().nullString() +} + +// FILE: J.java +import org.jetbrains.annotations.NotNull; + +public class J { + public @NotNull String nullString() { + return null; + } + + public Object test() { + return new C(); + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inPropertyGetterWithExpressionBody.kt b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inPropertyGetterWithExpressionBody.kt new file mode 100644 index 00000000000..84f13f3a8c0 --- /dev/null +++ b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inPropertyGetterWithExpressionBody.kt @@ -0,0 +1,29 @@ +// TARGET_BACKEND: JVM +// STRICT_JAVA_NULLABILITY_ASSERTIONS + +// FILE: box.kt +fun box(): String { + try { + J().test() + return "Fail: should throw" + } + catch (e: Throwable) { + return "OK" + } +} + +// FILE: test.kt +val withAssertion get() = J().nullString() + +// FILE: J.java +import org.jetbrains.annotations.NotNull; + +public class J { + public @NotNull String nullString() { + return null; + } + + public void test() { + TestKt.getWithAssertion(); + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inTopLevelPropertyInitializer.kt b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inTopLevelPropertyInitializer.kt new file mode 100644 index 00000000000..5d2e21b1d53 --- /dev/null +++ b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/enhancedNullability/inTopLevelPropertyInitializer.kt @@ -0,0 +1,31 @@ +// TARGET_BACKEND: JVM +// STRICT_JAVA_NULLABILITY_ASSERTIONS + +// FILE: box.kt +fun box(): String { + try { + J().test() + return "Fail: should throw" + } + catch (e: Throwable) { + return "OK" + } +} + +// FILE: test.kt +val withAssertion = J().nullString() + +fun clinitTrigger() {} + +// FILE: J.java +import org.jetbrains.annotations.NotNull; + +public class J { + public @NotNull String nullString() { + return null; + } + + public void test() { + TestKt.clinitTrigger(); + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/incWithNullabilityAssertionOnExtensionReceiverInPrivateOperator_lv11.kt b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/incWithNullabilityAssertionOnExtensionReceiverInPrivateOperator_lv11.kt new file mode 100644 index 00000000000..e14e5e764e4 --- /dev/null +++ b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/incWithNullabilityAssertionOnExtensionReceiverInPrivateOperator_lv11.kt @@ -0,0 +1,17 @@ +// TARGET_BACKEND: JVM +// FILE: test.kt +// WITH_RUNTIME +// LANGUAGE_VERSION: 1.1 +private operator fun A.inc() = A() + +fun box(): String { + var aNull = A.n() + aNull++ + // NB no exception is thrown in language version 1.1 + return "OK" +} + +// FILE: A.java +public class A { + public static A n() { return null; } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/incWithNullabilityAssertionOnExtensionReceiverInPrivateOperator_lv12.kt b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/incWithNullabilityAssertionOnExtensionReceiverInPrivateOperator_lv12.kt new file mode 100644 index 00000000000..2e09a3d9192 --- /dev/null +++ b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/incWithNullabilityAssertionOnExtensionReceiverInPrivateOperator_lv12.kt @@ -0,0 +1,21 @@ +// TARGET_BACKEND: JVM +// FILE: test.kt +// WITH_RUNTIME +// LANGUAGE_VERSION: 1.2 +import kotlin.test.* + +private operator fun A.inc() = A() + +fun box(): String { + assertFailsWith { + var aNull = A.n() + aNull++ + } + + return "OK" +} + +// FILE: A.java +public class A { + public static A n() { return null; } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/incWithNullabilityAssertionOnExtensionReceiver_lv11.kt b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/incWithNullabilityAssertionOnExtensionReceiver_lv11.kt new file mode 100644 index 00000000000..8c1121f7777 --- /dev/null +++ b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/incWithNullabilityAssertionOnExtensionReceiver_lv11.kt @@ -0,0 +1,21 @@ +// TARGET_BACKEND: JVM +// FILE: test.kt +// WITH_RUNTIME +// LANGUAGE_VERSION: 1.1 +import kotlin.test.* + +operator fun A.inc() = A() + +fun box(): String { + assertFailsWith { + var aNull = A.n() + aNull++ + } + + return "OK" +} + +// FILE: A.java +public class A { + public static A n() { return null; } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/incWithNullabilityAssertionOnExtensionReceiver_lv12.kt b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/incWithNullabilityAssertionOnExtensionReceiver_lv12.kt new file mode 100644 index 00000000000..330281df860 --- /dev/null +++ b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/incWithNullabilityAssertionOnExtensionReceiver_lv12.kt @@ -0,0 +1,21 @@ +// TARGET_BACKEND: JVM +// FILE: test.kt +// WITH_RUNTIME +// LANGUAGE_VERSION: 1.2 +import kotlin.test.* + +operator fun A.inc() = A() + +fun box(): String { + assertFailsWith { + var aNull = A.n() + aNull++ + } + + return "OK" +} + +// FILE: A.java +public class A { + public static A n() { return null; } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnExtensionReceiver_lv11.kt b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnExtensionReceiver_lv11.kt new file mode 100644 index 00000000000..70e926c8b18 --- /dev/null +++ b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnExtensionReceiver_lv11.kt @@ -0,0 +1,17 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +// LANGUAGE_VERSION: 1.1 +import kotlin.test.* + +fun String.extension() {} + +fun box(): String { + assertFailsWith { J.s().extension() } + return "OK" +} + +// FILE: J.java +public class J { + public static String s() { return null; } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnExtensionReceiver_lv12.kt b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnExtensionReceiver_lv12.kt new file mode 100644 index 00000000000..ece06c560ae --- /dev/null +++ b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnExtensionReceiver_lv12.kt @@ -0,0 +1,17 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +// LANGUAGE_VERSION: 1.2 +import kotlin.test.* + +fun String.extension() {} + +fun box(): String { + assertFailsWith { J.s().extension() } + return "OK" +} + +// FILE: J.java +public class J { + public static String s() { return null; } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnInlineFunExtensionReceiver_lv11.kt b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnInlineFunExtensionReceiver_lv11.kt new file mode 100644 index 00000000000..4547e585579 --- /dev/null +++ b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnInlineFunExtensionReceiver_lv11.kt @@ -0,0 +1,17 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +// LANGUAGE_VERSION: 1.1 +import kotlin.test.* + +inline fun String.extension() {} + +fun box(): String { + J.s().extension() // NB no exception thrown + return "OK" +} + +// FILE: J.java +public class J { + public static String s() { return null; } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnInlineFunExtensionReceiver_lv12.kt b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnInlineFunExtensionReceiver_lv12.kt new file mode 100644 index 00000000000..768e5c56e14 --- /dev/null +++ b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnInlineFunExtensionReceiver_lv12.kt @@ -0,0 +1,19 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +// LANGUAGE_VERSION: 1.2 +import kotlin.test.* + +inline fun String.extension() {} + +fun box(): String { + assertFailsWith { + J.s().extension() + } + return "OK" +} + +// FILE: J.java +public class J { + public static String s() { return null; } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnMemberExtensionReceiver_lv12.kt b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnMemberExtensionReceiver_lv12.kt new file mode 100644 index 00000000000..816f669d74d --- /dev/null +++ b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnMemberExtensionReceiver_lv12.kt @@ -0,0 +1,20 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +// LANGUAGE_VERSION: 1.2 +import kotlin.test.* + +class C { + fun test() { J.s().memberExtension() } + fun String.memberExtension() {} +} + +fun box(): String { + assertFailsWith { C().test() } + return "OK" +} + +// FILE: J.java +public class J { + public static String s() { return null; } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnPrivateMemberExtensionReceiver_lv12.kt b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnPrivateMemberExtensionReceiver_lv12.kt new file mode 100644 index 00000000000..5be1b082389 --- /dev/null +++ b/backend.native/tests/external/codegen/box/javaInterop/notNullAssertions/nullabilityAssertionOnPrivateMemberExtensionReceiver_lv12.kt @@ -0,0 +1,22 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +// LANGUAGE_VERSION: 1.2 +import kotlin.test.* + +class C { + fun test() { J.s().memberExtension() } + private fun String.memberExtension() {} +} + +fun box(): String { + assertFailsWith { + C().test() + } + return "OK" +} + +// FILE: J.java +public class J { + public static String s() { return null; } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/jvmPackageName/metadataField.kt b/backend.native/tests/external/codegen/box/jvmPackageName/metadataField.kt new file mode 100644 index 00000000000..3636bc85fc0 --- /dev/null +++ b/backend.native/tests/external/codegen/box/jvmPackageName/metadataField.kt @@ -0,0 +1,28 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// LANGUAGE_VERSION: 1.2 + +// FILE: foo.kt + +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") +@file:JvmPackageName("baz.foo.quux.bar") +package foo.bar + +fun f() {} + +// FILE: bar.kt + +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") + +fun getPackageName(classFqName: String): String = + Class.forName(classFqName).getAnnotation(Metadata::class.java).pn + +fun box(): String { + val bar = getPackageName("BarKt") + if (bar != "") return "Fail 1: $bar" + + val foo = getPackageName("baz.foo.quux.bar.FooKt") + if (foo != "foo.bar") return "Fail 2: $foo" + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/jvmPackageName/rootPackage.kt b/backend.native/tests/external/codegen/box/jvmPackageName/rootPackage.kt new file mode 100644 index 00000000000..475834f0ee7 --- /dev/null +++ b/backend.native/tests/external/codegen/box/jvmPackageName/rootPackage.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// LANGUAGE_VERSION: 1.2 + +// FILE: foo.kt + +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") +@file:JvmPackageName("jjj") + +fun f(): String = "O" + +val g: String? get() = "K" + +inline fun i(block: () -> String) = block() + +// FILE: bar.kt + +fun box(): String = i { f() + g } diff --git a/backend.native/tests/external/codegen/box/jvmPackageName/simple.kt b/backend.native/tests/external/codegen/box/jvmPackageName/simple.kt new file mode 100644 index 00000000000..01d9fac7917 --- /dev/null +++ b/backend.native/tests/external/codegen/box/jvmPackageName/simple.kt @@ -0,0 +1,21 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// LANGUAGE_VERSION: 1.2 + +// FILE: foo.kt + +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") +@file:JvmPackageName("baz.foo.quux.bar") +package foo.bar + +fun f(): String = "O" + +val g: String? get() = "K" + +inline fun i(block: () -> T): T = block() + +// FILE: bar.kt + +import foo.bar.* + +fun box(): String = i { f() + g } diff --git a/backend.native/tests/external/codegen/box/jvmPackageName/withJvmName.kt b/backend.native/tests/external/codegen/box/jvmPackageName/withJvmName.kt new file mode 100644 index 00000000000..df2917bef0e --- /dev/null +++ b/backend.native/tests/external/codegen/box/jvmPackageName/withJvmName.kt @@ -0,0 +1,19 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// LANGUAGE_VERSION: 1.2 + +// FILE: foo.kt + +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") +@file:JvmPackageName("jjj") +@file:JvmName("Foooo") + +fun f(): String = "O" + +val g: String? get() = "K" + +inline fun i(block: () -> String) = block() + +// FILE: bar.kt + +fun box(): String = i { f() + g } diff --git a/backend.native/tests/external/codegen/box/localClasses/closureOfInnerLocalClass.kt b/backend.native/tests/external/codegen/box/localClasses/closureOfInnerLocalClass.kt index c01ad313420..629b491a31d 100644 --- a/backend.native/tests/external/codegen/box/localClasses/closureOfInnerLocalClass.kt +++ b/backend.native/tests/external/codegen/box/localClasses/closureOfInnerLocalClass.kt @@ -1,5 +1,5 @@ // Enable for JVM backend when KT-8120 gets fixed -// TARGET_BACKEND: JS +// IGNORE_BACKEND: JVM fun box(): String { var log = "" diff --git a/backend.native/tests/external/codegen/box/localClasses/closureWithSelfInstantiation.kt b/backend.native/tests/external/codegen/box/localClasses/closureWithSelfInstantiation.kt index 206ccc3d5f7..20727829c28 100644 --- a/backend.native/tests/external/codegen/box/localClasses/closureWithSelfInstantiation.kt +++ b/backend.native/tests/external/codegen/box/localClasses/closureWithSelfInstantiation.kt @@ -1,5 +1,5 @@ // Enable for JVM backend when KT-8120 gets fixed -// TARGET_BACKEND: JS +// IGNORE_BACKEND: JVM fun box(): String { val capturedInConstructor = 1 diff --git a/backend.native/tests/external/codegen/box/localClasses/kt2873.kt b/backend.native/tests/external/codegen/box/localClasses/kt2873.kt index ffc8ef112ed..be5008511ac 100644 --- a/backend.native/tests/external/codegen/box/localClasses/kt2873.kt +++ b/backend.native/tests/external/codegen/box/localClasses/kt2873.kt @@ -7,5 +7,5 @@ fun foo() : String { } fun box(): String { - return foo() + return foo() } \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/nullCheckOptimization/trivialInstanceOf.kt b/backend.native/tests/external/codegen/box/nullCheckOptimization/trivialInstanceOf.kt new file mode 100644 index 00000000000..89a0f2d67ad --- /dev/null +++ b/backend.native/tests/external/codegen/box/nullCheckOptimization/trivialInstanceOf.kt @@ -0,0 +1,17 @@ +sealed class A { + class B : A() + + class C : A() +} + +inline fun foo(): A = A.B() + +fun box(): String { + val a: A = foo() + val b: Boolean + when (a) { + is A.B -> b = true + is A.C -> b = false + } + return if (b) "OK" else "FAIL" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/objects/classCompanion.kt b/backend.native/tests/external/codegen/box/objects/classCompanion.kt new file mode 100644 index 00000000000..66d6d588238 --- /dev/null +++ b/backend.native/tests/external/codegen/box/objects/classCompanion.kt @@ -0,0 +1,19 @@ +var result = "" + +class A { + + companion object { + + val prop = test() + + fun test(): String { + result += "OK" + return result + } + } +} + +fun box(): String { + if (A.prop != "OK") return "fail ${A.prop}" + return result +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/objects/interfaceCompanion.kt b/backend.native/tests/external/codegen/box/objects/interfaceCompanion.kt new file mode 100644 index 00000000000..924329d3b37 --- /dev/null +++ b/backend.native/tests/external/codegen/box/objects/interfaceCompanion.kt @@ -0,0 +1,19 @@ +var result = "" + +interface A { + + companion object { + + val prop = test() + + fun test(): String { + result += "OK" + return result + } + } +} + +fun box(): String { + if (A.prop != "OK") return "fail ${A.prop}" + return result +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/objects/interfaceCompanionObjectReference.kt b/backend.native/tests/external/codegen/box/objects/interfaceCompanionObjectReference.kt new file mode 100644 index 00000000000..6624b0a2bc9 --- /dev/null +++ b/backend.native/tests/external/codegen/box/objects/interfaceCompanionObjectReference.kt @@ -0,0 +1,37 @@ +// WITH_RUNTIME + +import kotlin.test.* + +interface Test { + companion object { + val x = "OK" + + val y1 = Test.x + + val y2 = 42.let { x } + + val y3: String + init { + fun localFun() = x + y3 = localFun() + } + + fun method() = x + val y4 = method() + + val anonObject = object { + override fun toString() = x + } + val y5 = anonObject.toString() + + init { + assertEquals(x, y1) + assertEquals(x, y2) + assertEquals(x, y3) + assertEquals(x, y4) + assertEquals(x, y5) + } + } +} + +fun box() = Test.x \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/objects/kt18982.kt b/backend.native/tests/external/codegen/box/objects/kt18982.kt new file mode 100644 index 00000000000..daf03fb9bf6 --- /dev/null +++ b/backend.native/tests/external/codegen/box/objects/kt18982.kt @@ -0,0 +1,9 @@ +import Foo.bar0 as bar + +object Foo { + val bar0 = "OK" + + fun test() = bar0 +} + +fun box() = Foo.test() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/objects/object.kt b/backend.native/tests/external/codegen/box/objects/object.kt new file mode 100644 index 00000000000..8ce9ee1c9ba --- /dev/null +++ b/backend.native/tests/external/codegen/box/objects/object.kt @@ -0,0 +1,15 @@ +var result = "" + +object A { + val prop = test() + + fun test(): String { + result += "OK" + return result + } +} + +fun box(): String { + if (A.prop != "OK") return "fail ${A.prop}" + return result +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/objects/selfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall.kt b/backend.native/tests/external/codegen/box/objects/selfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall.kt new file mode 100644 index 00000000000..099a68bfe1f --- /dev/null +++ b/backend.native/tests/external/codegen/box/objects/selfReferenceToCompanionObjectInAnonymousObjectInSuperConstructorCall.kt @@ -0,0 +1,17 @@ +interface IFn { + operator fun invoke(): String +} + +abstract class Base(val fn: IFn) + +class Host { + companion object : Base( + object : IFn { + override fun invoke(): String = Host.ok() + } + ) { + fun ok() = "OK" + } +} + +fun box() = Host.Companion.fn() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/objects/selfReferenceToCompanionObjectInInlineLambdaInConstructorBody.kt b/backend.native/tests/external/codegen/box/objects/selfReferenceToCompanionObjectInInlineLambdaInConstructorBody.kt new file mode 100644 index 00000000000..892e82811a1 --- /dev/null +++ b/backend.native/tests/external/codegen/box/objects/selfReferenceToCompanionObjectInInlineLambdaInConstructorBody.kt @@ -0,0 +1,9 @@ +class Test { + companion object { + fun ok() = "OK" + val x = run { Test.ok() } + fun test() = x + } +} + +fun box() = Test.test() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/objects/selfReferenceToCompanionObjectInInlineLambdaInSuperConstructorCall.kt b/backend.native/tests/external/codegen/box/objects/selfReferenceToCompanionObjectInInlineLambdaInSuperConstructorCall.kt new file mode 100644 index 00000000000..fc2a08dd42e --- /dev/null +++ b/backend.native/tests/external/codegen/box/objects/selfReferenceToCompanionObjectInInlineLambdaInSuperConstructorCall.kt @@ -0,0 +1,9 @@ +abstract class Base(val fn: () -> String) + +class Host { + companion object : Base(run { { Host.ok() } }) { + fun ok() = "OK" + } +} + +fun box() = Host.Companion.fn() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/objects/selfReferenceToCompanionObjectInLambdaInSuperConstructorCall.kt b/backend.native/tests/external/codegen/box/objects/selfReferenceToCompanionObjectInLambdaInSuperConstructorCall.kt new file mode 100644 index 00000000000..ff1e7b7f631 --- /dev/null +++ b/backend.native/tests/external/codegen/box/objects/selfReferenceToCompanionObjectInLambdaInSuperConstructorCall.kt @@ -0,0 +1,9 @@ +abstract class Base(val fn: () -> String) + +class Host { + companion object : Base({ Host.ok() }) { + fun ok() = "OK" + } +} + +fun box() = Host.Companion.fn() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall.kt b/backend.native/tests/external/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall.kt new file mode 100644 index 00000000000..f1b33e5ba20 --- /dev/null +++ b/backend.native/tests/external/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInAnonymousObjectInSuperConstructorCall.kt @@ -0,0 +1,17 @@ +interface IFn { + operator fun invoke(): String +} + +abstract class Base(val fn: IFn) + +interface Host { + companion object : Base( + object : IFn { + override fun invoke(): String = Host.ok() + } + ) { + fun ok() = "OK" + } +} + +fun box() = Host.Companion.fn() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInInlineLambdaInConstructorBody.kt b/backend.native/tests/external/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInInlineLambdaInConstructorBody.kt new file mode 100644 index 00000000000..faccd52f1a4 --- /dev/null +++ b/backend.native/tests/external/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInInlineLambdaInConstructorBody.kt @@ -0,0 +1,9 @@ +interface Test { + companion object { + fun ok() = "OK" + val x = run { Test.ok() } + fun test() = x + } +} + +fun box() = Test.test() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInInlineLambdaInSuperConstructorCall.kt b/backend.native/tests/external/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInInlineLambdaInSuperConstructorCall.kt new file mode 100644 index 00000000000..226506094b2 --- /dev/null +++ b/backend.native/tests/external/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInInlineLambdaInSuperConstructorCall.kt @@ -0,0 +1,9 @@ +abstract class Base(val fn: () -> String) + +interface Host { + companion object : Base(run { { Host.ok() } }) { + fun ok() = "OK" + } +} + +fun box() = Host.Companion.fn() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInLambdaInSuperConstructorCall.kt b/backend.native/tests/external/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInLambdaInSuperConstructorCall.kt new file mode 100644 index 00000000000..a6e6f034c26 --- /dev/null +++ b/backend.native/tests/external/codegen/box/objects/selfReferenceToInterfaceCompanionObjectInLambdaInSuperConstructorCall.kt @@ -0,0 +1,9 @@ +abstract class Base(val fn: () -> String) + +interface Host { + companion object : Base({ Host.ok() }) { + fun ok() = "OK" + } +} + +fun box() = Host.Companion.fn() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/objects/selfReferenceToObjectInAnonymousObjectInSuperConstructorCall.kt b/backend.native/tests/external/codegen/box/objects/selfReferenceToObjectInAnonymousObjectInSuperConstructorCall.kt new file mode 100644 index 00000000000..2239c1b09e9 --- /dev/null +++ b/backend.native/tests/external/codegen/box/objects/selfReferenceToObjectInAnonymousObjectInSuperConstructorCall.kt @@ -0,0 +1,15 @@ +interface IFn { + operator fun invoke(): String +} + +abstract class Base(val fn: IFn) + +object Test : Base( + object : IFn { + override fun invoke(): String = Test.ok() + } +) { + fun ok() = "OK" +} + +fun box() = Test.fn() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/objects/selfReferenceToObjectInInlineLambdaInConstructorBody.kt b/backend.native/tests/external/codegen/box/objects/selfReferenceToObjectInInlineLambdaInConstructorBody.kt new file mode 100644 index 00000000000..88cfbb44f32 --- /dev/null +++ b/backend.native/tests/external/codegen/box/objects/selfReferenceToObjectInInlineLambdaInConstructorBody.kt @@ -0,0 +1,7 @@ +object Test { + fun ok() = "OK" + val x = run { Test.ok() } + fun test() = x +} + +fun box() = Test.test() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/objects/selfReferenceToObjectInInlineLambdaInSuperConstructorCall.kt b/backend.native/tests/external/codegen/box/objects/selfReferenceToObjectInInlineLambdaInSuperConstructorCall.kt new file mode 100644 index 00000000000..045499084e6 --- /dev/null +++ b/backend.native/tests/external/codegen/box/objects/selfReferenceToObjectInInlineLambdaInSuperConstructorCall.kt @@ -0,0 +1,7 @@ +abstract class Base(val fn: () -> String) + +object Test : Base(run { { Test.ok() } }) { + fun ok() = "OK" +} + +fun box() = Test.fn() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/objects/selfReferenceToObjectInLambdaInSuperConstructorCall.kt b/backend.native/tests/external/codegen/box/objects/selfReferenceToObjectInLambdaInSuperConstructorCall.kt new file mode 100644 index 00000000000..e12b6882c7d --- /dev/null +++ b/backend.native/tests/external/codegen/box/objects/selfReferenceToObjectInLambdaInSuperConstructorCall.kt @@ -0,0 +1,7 @@ +abstract class Base(val fn: () -> String) + +object Test : Base({ Test.ok() }) { + fun ok() = "OK" +} + +fun box() = Test.fn() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/operatorConventions/compareTo/boolean.kt b/backend.native/tests/external/codegen/box/operatorConventions/compareTo/boolean.kt index a8a367c3354..833e11a733a 100644 --- a/backend.native/tests/external/codegen/box/operatorConventions/compareTo/boolean.kt +++ b/backend.native/tests/external/codegen/box/operatorConventions/compareTo/boolean.kt @@ -1,6 +1,3 @@ -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - fun checkLess(x: Boolean, y: Boolean) = when { x >= y -> "Fail $x >= $y" !(x < y) -> "Fail !($x < $y)" diff --git a/backend.native/tests/external/codegen/box/operatorConventions/kt20387.kt b/backend.native/tests/external/codegen/box/operatorConventions/kt20387.kt new file mode 100644 index 00000000000..95fcaa70ec6 --- /dev/null +++ b/backend.native/tests/external/codegen/box/operatorConventions/kt20387.kt @@ -0,0 +1,17 @@ +// FILE: test.kt +import base.* + +class Derived : Base() { + inner class Inner { + fun foo() = this@Derived[0L] + } +} + +fun box() = Derived().Inner().foo() + +// FILE: Base.kt +package base + +open class Base { + protected operator fun get(key: K) = "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/platformTypes/primitives/equalsNull_lv11.kt b/backend.native/tests/external/codegen/box/platformTypes/primitives/equalsNull_lv11.kt new file mode 100644 index 00000000000..981310ecabe --- /dev/null +++ b/backend.native/tests/external/codegen/box/platformTypes/primitives/equalsNull_lv11.kt @@ -0,0 +1,39 @@ +// LANGUAGE_VERSION: 1.1 +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +import kotlin.test.* + +fun box(): String { + assertEquals(J.BOOL_NULL.equals(null), true) + assertEquals(J.CHAR_NULL.equals(null), true) + assertEquals(J.BYTE_NULL.equals(null), true) + assertEquals(J.SHORT_NULL.equals(null), true) + assertEquals(J.INT_NULL.equals(null), true) + assertEquals(J.LONG_NULL.equals(null), true) + assertEquals(J.FLOAT_NULL.equals(null), true) + assertEquals(J.DOUBLE_NULL.equals(null), true) + + assertEquals(J.BOOL_NULL == null, true) + assertEquals(J.CHAR_NULL == null, true) + assertEquals(J.BYTE_NULL == null, true) + assertEquals(J.SHORT_NULL == null, true) + assertEquals(J.INT_NULL == null, true) + assertEquals(J.LONG_NULL == null, true) + assertEquals(J.FLOAT_NULL == null, true) + assertEquals(J.DOUBLE_NULL == null, true) + + return "OK" +} + +// FILE: J.java +public class J { + public static Boolean BOOL_NULL = null; + public static Character CHAR_NULL = null; + public static Byte BYTE_NULL = null; + public static Short SHORT_NULL = null; + public static Integer INT_NULL = null; + public static Long LONG_NULL = null; + public static Float FLOAT_NULL = null; + public static Double DOUBLE_NULL = null; +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/platformTypes/primitives/equalsNull_lv12.kt b/backend.native/tests/external/codegen/box/platformTypes/primitives/equalsNull_lv12.kt new file mode 100644 index 00000000000..1a4f0c850c4 --- /dev/null +++ b/backend.native/tests/external/codegen/box/platformTypes/primitives/equalsNull_lv12.kt @@ -0,0 +1,39 @@ +// LANGUAGE_VERSION: 1.2 +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +import kotlin.test.* + +fun box(): String { + assertFailsWith { J.BOOL_NULL.equals(null) } + assertFailsWith { J.CHAR_NULL.equals(null) } + assertFailsWith { J.BYTE_NULL.equals(null) } + assertFailsWith { J.SHORT_NULL.equals(null) } + assertFailsWith { J.INT_NULL.equals(null) } + assertFailsWith { J.LONG_NULL.equals(null) } + assertFailsWith { J.FLOAT_NULL.equals(null) } + assertFailsWith { J.DOUBLE_NULL.equals(null) } + + assertEquals(J.BOOL_NULL == null, true) + assertEquals(J.CHAR_NULL == null, true) + assertEquals(J.BYTE_NULL == null, true) + assertEquals(J.SHORT_NULL == null, true) + assertEquals(J.INT_NULL == null, true) + assertEquals(J.LONG_NULL == null, true) + assertEquals(J.FLOAT_NULL == null, true) + assertEquals(J.DOUBLE_NULL == null, true) + + return "OK" +} + +// FILE: J.java +public class J { + public static Boolean BOOL_NULL = null; + public static Character CHAR_NULL = null; + public static Byte BYTE_NULL = null; + public static Short SHORT_NULL = null; + public static Integer INT_NULL = null; + public static Long LONG_NULL = null; + public static Float FLOAT_NULL = null; + public static Double DOUBLE_NULL = null; +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/platformTypes/primitives/equalsNull_withExplicitFlag.kt b/backend.native/tests/external/codegen/box/platformTypes/primitives/equalsNull_withExplicitFlag.kt new file mode 100644 index 00000000000..4d7aba6b1a9 --- /dev/null +++ b/backend.native/tests/external/codegen/box/platformTypes/primitives/equalsNull_withExplicitFlag.kt @@ -0,0 +1,40 @@ +// LANGUAGE_VERSION: 1.2 +// KOTLIN_CONFIGURATION_FLAGS: +JVM.NO_EXCEPTION_ON_EXPLICIT_EQUALS_FOR_BOXED_NULL +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FILE: test.kt +import kotlin.test.* + +fun box(): String { + assertEquals(J.BOOL_NULL.equals(null), true) + assertEquals(J.CHAR_NULL.equals(null), true) + assertEquals(J.BYTE_NULL.equals(null), true) + assertEquals(J.SHORT_NULL.equals(null), true) + assertEquals(J.INT_NULL.equals(null), true) + assertEquals(J.LONG_NULL.equals(null), true) + assertEquals(J.FLOAT_NULL.equals(null), true) + assertEquals(J.DOUBLE_NULL.equals(null), true) + + assertEquals(J.BOOL_NULL == null, true) + assertEquals(J.CHAR_NULL == null, true) + assertEquals(J.BYTE_NULL == null, true) + assertEquals(J.SHORT_NULL == null, true) + assertEquals(J.INT_NULL == null, true) + assertEquals(J.LONG_NULL == null, true) + assertEquals(J.FLOAT_NULL == null, true) + assertEquals(J.DOUBLE_NULL == null, true) + + return "OK" +} + +// FILE: J.java +public class J { + public static Boolean BOOL_NULL = null; + public static Character CHAR_NULL = null; + public static Byte BYTE_NULL = null; + public static Short SHORT_NULL = null; + public static Integer INT_NULL = null; + public static Long LONG_NULL = null; + public static Float FLOAT_NULL = null; + public static Double DOUBLE_NULL = null; +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/conversions.kt b/backend.native/tests/external/codegen/box/primitiveTypes/conversions.kt new file mode 100644 index 00000000000..a8521d51a0a --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/conversions.kt @@ -0,0 +1,56 @@ +// WITH_RUNTIME +import kotlin.test.assertEquals + +fun box(): String { + + assertEquals(-2147483648, Float.NEGATIVE_INFINITY.toInt()) + assertEquals(-2147483648, (-Float.MAX_VALUE).toInt()) + assertEquals(-1, (-1.9f).toInt()) + assertEquals(0, (-0.0f).toInt()) + assertEquals(0, (-Float.MIN_VALUE).toInt()) + assertEquals(0, 0.0f.toInt()) + assertEquals(0, Float.NaN.toInt()) + assertEquals(0, Float.MIN_VALUE.toInt()) + assertEquals(0, 0.9f.toInt()) + assertEquals(2147483647, Float.MAX_VALUE.toInt()) + assertEquals(2147483647, Float.POSITIVE_INFINITY.toInt()) + + assertEquals(-2147483648, Double.NEGATIVE_INFINITY.toInt()) + assertEquals(-2147483648, (-Double.MAX_VALUE).toInt()) + assertEquals(-2147483648, (-2147483649.0).toInt()) + assertEquals(-2147483648, (-2147483648.0).toInt()) + assertEquals(-2147483647, (-2147483647.9).toInt()) + assertEquals(-1, (-1.9).toInt()) + assertEquals(0, (-0.0).toInt()) + assertEquals(0, (-Double.MIN_VALUE).toInt()) + assertEquals(0, 0.0.toInt()) + assertEquals(0, Double.NaN.toInt()) + assertEquals(0, Double.MIN_VALUE.toInt()) + assertEquals(0, 0.9.toInt()) + assertEquals(2147483646, 2147483646.9.toInt()) + assertEquals(2147483647, 2147483647.0.toInt()) + assertEquals(2147483647, 2147483648.0.toInt()) + assertEquals(2147483647, Double.MAX_VALUE.toInt()) + assertEquals(2147483647, Double.POSITIVE_INFINITY.toInt()) + + for (d in doubleArrayOf(Double.NEGATIVE_INFINITY, -Double.MAX_VALUE, + -2147483649.0, -2147483648.0, -2147483647.0, + -65536.0, -65535.0, -65534.0, + -1.5, -Double.MIN_VALUE, + -0.0, 0.0, + Double.MIN_VALUE, 1.5, + 65534.0, 65535.0, 65536.0, + 2147483647.0, 2147483648.0, 2147483649.0, + Double.MAX_VALUE, Double.POSITIVE_INFINITY)) { + assertEquals(d.toInt().toByte(), d.toByte()) + assertEquals(d.toInt().toShort(), d.toShort()) + assertEquals(d.toInt().toChar(), d.toChar()) + + val f = d.toFloat() + assertEquals(f.toInt().toByte(), f.toByte()) + assertEquals(f.toInt().toShort(), f.toShort()) + assertEquals(f.toInt().toChar(), f.toChar()) + } + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/boxedEqPrimitiveEvaluationOrder.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/boxedEqPrimitiveEvaluationOrder.kt new file mode 100644 index 00000000000..5fd58629899 --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/boxedEqPrimitiveEvaluationOrder.kt @@ -0,0 +1,39 @@ +var order: String = "" + +fun a(i: Int): Int? { + order += "a" + return i +} + +fun b(i: Int): Int { + order += "b" + return i +} + +inline fun evaluateAndCheckOrder(marker: String, expectedValue: Boolean, expectedOrder: String, expr: () -> Boolean) { + order = "" + val actualValue = expr() + if (actualValue != expectedValue) throw AssertionError("$marker: Expected: $expectedValue, actual: $actualValue") + if (order != expectedOrder) throw AssertionError("$marker, order: Expected: '$expectedOrder', actual: '$order'") +} + +val nn: Int? = null + +fun box(): String { + evaluateAndCheckOrder("1 == 1", true, "ab") { a(1) == b(1) } + evaluateAndCheckOrder("1 == 2", false, "ab") { a(1) == b(2) } + evaluateAndCheckOrder("1 != 1", false, "ab") { a(1) != b(1) } + evaluateAndCheckOrder("1 != 2", true, "ab") { a(1) != b(2) } + + evaluateAndCheckOrder("!(1 == 2)", true, "ab") { !(a(1) == b(2)) } + evaluateAndCheckOrder("!(1 == 1)", false, "ab") { !(a(1) == b(1)) } + evaluateAndCheckOrder("!(1 != 2)", false, "ab") { !(a(1) != b(2)) } + evaluateAndCheckOrder("!(1 != 1)", true, "ab") { !(a(1) != b(1)) } + + evaluateAndCheckOrder("null == 1", false, "a") { nn == a(1) } + evaluateAndCheckOrder("null != 1", true, "a") { nn != a(1) } + evaluateAndCheckOrder("!(null == 1)", true, "a") { !(nn == a(1)) } + evaluateAndCheckOrder("!(null != 1)", false, "a") { !(nn != a(1)) } + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/boxedLongEqualsLong.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/boxedLongEqualsLong.kt new file mode 100644 index 00000000000..9f589c7d3aa --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/boxedLongEqualsLong.kt @@ -0,0 +1,6 @@ +val x: Long = 0L + +fun box(): String { + val ax: Long? = 0L + return if (ax != x) "Fail" else "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveBoolean.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveBoolean.kt new file mode 100644 index 00000000000..a4c037d5d19 --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveBoolean.kt @@ -0,0 +1,47 @@ +// Auto-generated by GeneratePrimitiveVsObjectEqualityTestData. Do not edit! + +val nx: Boolean? = true +val nn: Boolean? = null +val x: Boolean = true +val y: Boolean = false + +fun box(): String { + val ax: Boolean? = true + val an: Boolean? = null + val bx: Boolean = true + val by: Boolean = false + + return when { + nx != true -> "Fail 0" + nx == false -> "Fail 1" + !(nx == true) -> "Fail 2" + !(nx != false) -> "Fail 3" + nx != x -> "Fail 4" + nx == y -> "Fail 5" + !(nx == x) -> "Fail 6" + !(nx != y) -> "Fail 7" + nn == true -> "Fail 8" + !(nn != true) -> "Fail 9" + nn == x -> "Fail 10" + !(nn != x) -> "Fail 11" + ax != true -> "Fail 12" + ax == false -> "Fail 13" + !(ax == true) -> "Fail 14" + !(ax != false) -> "Fail 15" + ax != x -> "Fail 16" + ax == y -> "Fail 17" + !(ax == x) -> "Fail 18" + !(ax != y) -> "Fail 19" + ax != bx -> "Fail 20" + ax == by -> "Fail 21" + !(ax == bx) -> "Fail 22" + !(ax != by) -> "Fail 23" + an == true -> "Fail 24" + !(an != true) -> "Fail 25" + an == x -> "Fail 26" + !(an != x) -> "Fail 27" + an == bx -> "Fail 28" + !(an != bx) -> "Fail 29" + else -> "OK" + } +} diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveByte.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveByte.kt new file mode 100644 index 00000000000..327054de5dd --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveByte.kt @@ -0,0 +1,47 @@ +// Auto-generated by GeneratePrimitiveVsObjectEqualityTestData. Do not edit! + +val nx: Byte? = 0.toByte() +val nn: Byte? = null +val x: Byte = 0.toByte() +val y: Byte = 1.toByte() + +fun box(): String { + val ax: Byte? = 0.toByte() + val an: Byte? = null + val bx: Byte = 0.toByte() + val by: Byte = 1.toByte() + + return when { + nx != 0.toByte() -> "Fail 0" + nx == 1.toByte() -> "Fail 1" + !(nx == 0.toByte()) -> "Fail 2" + !(nx != 1.toByte()) -> "Fail 3" + nx != x -> "Fail 4" + nx == y -> "Fail 5" + !(nx == x) -> "Fail 6" + !(nx != y) -> "Fail 7" + nn == 0.toByte() -> "Fail 8" + !(nn != 0.toByte()) -> "Fail 9" + nn == x -> "Fail 10" + !(nn != x) -> "Fail 11" + ax != 0.toByte() -> "Fail 12" + ax == 1.toByte() -> "Fail 13" + !(ax == 0.toByte()) -> "Fail 14" + !(ax != 1.toByte()) -> "Fail 15" + ax != x -> "Fail 16" + ax == y -> "Fail 17" + !(ax == x) -> "Fail 18" + !(ax != y) -> "Fail 19" + ax != bx -> "Fail 20" + ax == by -> "Fail 21" + !(ax == bx) -> "Fail 22" + !(ax != by) -> "Fail 23" + an == 0.toByte() -> "Fail 24" + !(an != 0.toByte()) -> "Fail 25" + an == x -> "Fail 26" + !(an != x) -> "Fail 27" + an == bx -> "Fail 28" + !(an != bx) -> "Fail 29" + else -> "OK" + } +} diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveChar.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveChar.kt new file mode 100644 index 00000000000..589fe0b563f --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveChar.kt @@ -0,0 +1,47 @@ +// Auto-generated by GeneratePrimitiveVsObjectEqualityTestData. Do not edit! + +val nx: Char? = '0' +val nn: Char? = null +val x: Char = '0' +val y: Char = '1' + +fun box(): String { + val ax: Char? = '0' + val an: Char? = null + val bx: Char = '0' + val by: Char = '1' + + return when { + nx != '0' -> "Fail 0" + nx == '1' -> "Fail 1" + !(nx == '0') -> "Fail 2" + !(nx != '1') -> "Fail 3" + nx != x -> "Fail 4" + nx == y -> "Fail 5" + !(nx == x) -> "Fail 6" + !(nx != y) -> "Fail 7" + nn == '0' -> "Fail 8" + !(nn != '0') -> "Fail 9" + nn == x -> "Fail 10" + !(nn != x) -> "Fail 11" + ax != '0' -> "Fail 12" + ax == '1' -> "Fail 13" + !(ax == '0') -> "Fail 14" + !(ax != '1') -> "Fail 15" + ax != x -> "Fail 16" + ax == y -> "Fail 17" + !(ax == x) -> "Fail 18" + !(ax != y) -> "Fail 19" + ax != bx -> "Fail 20" + ax == by -> "Fail 21" + !(ax == bx) -> "Fail 22" + !(ax != by) -> "Fail 23" + an == '0' -> "Fail 24" + !(an != '0') -> "Fail 25" + an == x -> "Fail 26" + !(an != x) -> "Fail 27" + an == bx -> "Fail 28" + !(an != bx) -> "Fail 29" + else -> "OK" + } +} diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveInt.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveInt.kt new file mode 100644 index 00000000000..8b816d0b70b --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveInt.kt @@ -0,0 +1,47 @@ +// Auto-generated by GeneratePrimitiveVsObjectEqualityTestData. Do not edit! + +val nx: Int? = 0 +val nn: Int? = null +val x: Int = 0 +val y: Int = 1 + +fun box(): String { + val ax: Int? = 0 + val an: Int? = null + val bx: Int = 0 + val by: Int = 1 + + return when { + nx != 0 -> "Fail 0" + nx == 1 -> "Fail 1" + !(nx == 0) -> "Fail 2" + !(nx != 1) -> "Fail 3" + nx != x -> "Fail 4" + nx == y -> "Fail 5" + !(nx == x) -> "Fail 6" + !(nx != y) -> "Fail 7" + nn == 0 -> "Fail 8" + !(nn != 0) -> "Fail 9" + nn == x -> "Fail 10" + !(nn != x) -> "Fail 11" + ax != 0 -> "Fail 12" + ax == 1 -> "Fail 13" + !(ax == 0) -> "Fail 14" + !(ax != 1) -> "Fail 15" + ax != x -> "Fail 16" + ax == y -> "Fail 17" + !(ax == x) -> "Fail 18" + !(ax != y) -> "Fail 19" + ax != bx -> "Fail 20" + ax == by -> "Fail 21" + !(ax == bx) -> "Fail 22" + !(ax != by) -> "Fail 23" + an == 0 -> "Fail 24" + !(an != 0) -> "Fail 25" + an == x -> "Fail 26" + !(an != x) -> "Fail 27" + an == bx -> "Fail 28" + !(an != bx) -> "Fail 29" + else -> "OK" + } +} diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveLong.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveLong.kt new file mode 100644 index 00000000000..57253df6725 --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveLong.kt @@ -0,0 +1,47 @@ +// Auto-generated by GeneratePrimitiveVsObjectEqualityTestData. Do not edit! + +val nx: Long? = 0L +val nn: Long? = null +val x: Long = 0L +val y: Long = 1L + +fun box(): String { + val ax: Long? = 0L + val an: Long? = null + val bx: Long = 0L + val by: Long = 1L + + return when { + nx != 0L -> "Fail 0" + nx == 1L -> "Fail 1" + !(nx == 0L) -> "Fail 2" + !(nx != 1L) -> "Fail 3" + nx != x -> "Fail 4" + nx == y -> "Fail 5" + !(nx == x) -> "Fail 6" + !(nx != y) -> "Fail 7" + nn == 0L -> "Fail 8" + !(nn != 0L) -> "Fail 9" + nn == x -> "Fail 10" + !(nn != x) -> "Fail 11" + ax != 0L -> "Fail 12" + ax == 1L -> "Fail 13" + !(ax == 0L) -> "Fail 14" + !(ax != 1L) -> "Fail 15" + ax != x -> "Fail 16" + ax == y -> "Fail 17" + !(ax == x) -> "Fail 18" + !(ax != y) -> "Fail 19" + ax != bx -> "Fail 20" + ax == by -> "Fail 21" + !(ax == bx) -> "Fail 22" + !(ax != by) -> "Fail 23" + an == 0L -> "Fail 24" + !(an != 0L) -> "Fail 25" + an == x -> "Fail 26" + !(an != x) -> "Fail 27" + an == bx -> "Fail 28" + !(an != bx) -> "Fail 29" + else -> "OK" + } +} diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveShort.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveShort.kt new file mode 100644 index 00000000000..e93839a29c1 --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/boxedEqPrimitiveShort.kt @@ -0,0 +1,47 @@ +// Auto-generated by GeneratePrimitiveVsObjectEqualityTestData. Do not edit! + +val nx: Short? = 0.toShort() +val nn: Short? = null +val x: Short = 0.toShort() +val y: Short = 1.toShort() + +fun box(): String { + val ax: Short? = 0.toShort() + val an: Short? = null + val bx: Short = 0.toShort() + val by: Short = 1.toShort() + + return when { + nx != 0.toShort() -> "Fail 0" + nx == 1.toShort() -> "Fail 1" + !(nx == 0.toShort()) -> "Fail 2" + !(nx != 1.toShort()) -> "Fail 3" + nx != x -> "Fail 4" + nx == y -> "Fail 5" + !(nx == x) -> "Fail 6" + !(nx != y) -> "Fail 7" + nn == 0.toShort() -> "Fail 8" + !(nn != 0.toShort()) -> "Fail 9" + nn == x -> "Fail 10" + !(nn != x) -> "Fail 11" + ax != 0.toShort() -> "Fail 12" + ax == 1.toShort() -> "Fail 13" + !(ax == 0.toShort()) -> "Fail 14" + !(ax != 1.toShort()) -> "Fail 15" + ax != x -> "Fail 16" + ax == y -> "Fail 17" + !(ax == x) -> "Fail 18" + !(ax != y) -> "Fail 19" + ax != bx -> "Fail 20" + ax == by -> "Fail 21" + !(ax == bx) -> "Fail 22" + !(ax != by) -> "Fail 23" + an == 0.toShort() -> "Fail 24" + !(an != 0.toShort()) -> "Fail 25" + an == x -> "Fail 26" + !(an != x) -> "Fail 27" + an == bx -> "Fail 28" + !(an != bx) -> "Fail 29" + else -> "OK" + } +} diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedBoolean.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedBoolean.kt new file mode 100644 index 00000000000..a80c77136ad --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedBoolean.kt @@ -0,0 +1,47 @@ +// Auto-generated by GeneratePrimitiveVsObjectEqualityTestData. Do not edit! + +val nx: Boolean? = true +val nn: Boolean? = null +val x: Boolean = true +val y: Boolean = false + +fun box(): String { + val ax: Boolean? = true + val an: Boolean? = null + val bx: Boolean = true + val by: Boolean = false + + return when { + true != nx -> "Fail 0" + false == nx -> "Fail 1" + !(true == nx) -> "Fail 2" + !(false != nx) -> "Fail 3" + x != nx -> "Fail 4" + y == nx -> "Fail 5" + !(x == nx) -> "Fail 6" + !(y != nx) -> "Fail 7" + true == nn -> "Fail 8" + !(true != nn) -> "Fail 9" + x == nn -> "Fail 10" + !(x != nn) -> "Fail 11" + true != ax -> "Fail 12" + false == ax -> "Fail 13" + !(true == ax) -> "Fail 14" + !(false != ax) -> "Fail 15" + x != ax -> "Fail 16" + y == ax -> "Fail 17" + !(x == ax) -> "Fail 18" + !(y != ax) -> "Fail 19" + bx != ax -> "Fail 20" + by == ax -> "Fail 21" + !(bx == ax) -> "Fail 22" + !(by != ax) -> "Fail 23" + true == an -> "Fail 24" + !(true != an) -> "Fail 25" + x == an -> "Fail 26" + !(x != an) -> "Fail 27" + bx == an -> "Fail 28" + !(bx != an) -> "Fail 29" + else -> "OK" + } +} diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedByte.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedByte.kt new file mode 100644 index 00000000000..937d82722fa --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedByte.kt @@ -0,0 +1,47 @@ +// Auto-generated by GeneratePrimitiveVsObjectEqualityTestData. Do not edit! + +val nx: Byte? = 0.toByte() +val nn: Byte? = null +val x: Byte = 0.toByte() +val y: Byte = 1.toByte() + +fun box(): String { + val ax: Byte? = 0.toByte() + val an: Byte? = null + val bx: Byte = 0.toByte() + val by: Byte = 1.toByte() + + return when { + 0.toByte() != nx -> "Fail 0" + 1.toByte() == nx -> "Fail 1" + !(0.toByte() == nx) -> "Fail 2" + !(1.toByte() != nx) -> "Fail 3" + x != nx -> "Fail 4" + y == nx -> "Fail 5" + !(x == nx) -> "Fail 6" + !(y != nx) -> "Fail 7" + 0.toByte() == nn -> "Fail 8" + !(0.toByte() != nn) -> "Fail 9" + x == nn -> "Fail 10" + !(x != nn) -> "Fail 11" + 0.toByte() != ax -> "Fail 12" + 1.toByte() == ax -> "Fail 13" + !(0.toByte() == ax) -> "Fail 14" + !(1.toByte() != ax) -> "Fail 15" + x != ax -> "Fail 16" + y == ax -> "Fail 17" + !(x == ax) -> "Fail 18" + !(y != ax) -> "Fail 19" + bx != ax -> "Fail 20" + by == ax -> "Fail 21" + !(bx == ax) -> "Fail 22" + !(by != ax) -> "Fail 23" + 0.toByte() == an -> "Fail 24" + !(0.toByte() != an) -> "Fail 25" + x == an -> "Fail 26" + !(x != an) -> "Fail 27" + bx == an -> "Fail 28" + !(bx != an) -> "Fail 29" + else -> "OK" + } +} diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedChar.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedChar.kt new file mode 100644 index 00000000000..331ab442988 --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedChar.kt @@ -0,0 +1,47 @@ +// Auto-generated by GeneratePrimitiveVsObjectEqualityTestData. Do not edit! + +val nx: Char? = '0' +val nn: Char? = null +val x: Char = '0' +val y: Char = '1' + +fun box(): String { + val ax: Char? = '0' + val an: Char? = null + val bx: Char = '0' + val by: Char = '1' + + return when { + '0' != nx -> "Fail 0" + '1' == nx -> "Fail 1" + !('0' == nx) -> "Fail 2" + !('1' != nx) -> "Fail 3" + x != nx -> "Fail 4" + y == nx -> "Fail 5" + !(x == nx) -> "Fail 6" + !(y != nx) -> "Fail 7" + '0' == nn -> "Fail 8" + !('0' != nn) -> "Fail 9" + x == nn -> "Fail 10" + !(x != nn) -> "Fail 11" + '0' != ax -> "Fail 12" + '1' == ax -> "Fail 13" + !('0' == ax) -> "Fail 14" + !('1' != ax) -> "Fail 15" + x != ax -> "Fail 16" + y == ax -> "Fail 17" + !(x == ax) -> "Fail 18" + !(y != ax) -> "Fail 19" + bx != ax -> "Fail 20" + by == ax -> "Fail 21" + !(bx == ax) -> "Fail 22" + !(by != ax) -> "Fail 23" + '0' == an -> "Fail 24" + !('0' != an) -> "Fail 25" + x == an -> "Fail 26" + !(x != an) -> "Fail 27" + bx == an -> "Fail 28" + !(bx != an) -> "Fail 29" + else -> "OK" + } +} diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedInt.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedInt.kt new file mode 100644 index 00000000000..a9e3946fa90 --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedInt.kt @@ -0,0 +1,47 @@ +// Auto-generated by GeneratePrimitiveVsObjectEqualityTestData. Do not edit! + +val nx: Int? = 0 +val nn: Int? = null +val x: Int = 0 +val y: Int = 1 + +fun box(): String { + val ax: Int? = 0 + val an: Int? = null + val bx: Int = 0 + val by: Int = 1 + + return when { + 0 != nx -> "Fail 0" + 1 == nx -> "Fail 1" + !(0 == nx) -> "Fail 2" + !(1 != nx) -> "Fail 3" + x != nx -> "Fail 4" + y == nx -> "Fail 5" + !(x == nx) -> "Fail 6" + !(y != nx) -> "Fail 7" + 0 == nn -> "Fail 8" + !(0 != nn) -> "Fail 9" + x == nn -> "Fail 10" + !(x != nn) -> "Fail 11" + 0 != ax -> "Fail 12" + 1 == ax -> "Fail 13" + !(0 == ax) -> "Fail 14" + !(1 != ax) -> "Fail 15" + x != ax -> "Fail 16" + y == ax -> "Fail 17" + !(x == ax) -> "Fail 18" + !(y != ax) -> "Fail 19" + bx != ax -> "Fail 20" + by == ax -> "Fail 21" + !(bx == ax) -> "Fail 22" + !(by != ax) -> "Fail 23" + 0 == an -> "Fail 24" + !(0 != an) -> "Fail 25" + x == an -> "Fail 26" + !(x != an) -> "Fail 27" + bx == an -> "Fail 28" + !(bx != an) -> "Fail 29" + else -> "OK" + } +} diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedLong.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedLong.kt new file mode 100644 index 00000000000..e2eccb0ddf5 --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedLong.kt @@ -0,0 +1,47 @@ +// Auto-generated by GeneratePrimitiveVsObjectEqualityTestData. Do not edit! + +val nx: Long? = 0L +val nn: Long? = null +val x: Long = 0L +val y: Long = 1L + +fun box(): String { + val ax: Long? = 0L + val an: Long? = null + val bx: Long = 0L + val by: Long = 1L + + return when { + 0L != nx -> "Fail 0" + 1L == nx -> "Fail 1" + !(0L == nx) -> "Fail 2" + !(1L != nx) -> "Fail 3" + x != nx -> "Fail 4" + y == nx -> "Fail 5" + !(x == nx) -> "Fail 6" + !(y != nx) -> "Fail 7" + 0L == nn -> "Fail 8" + !(0L != nn) -> "Fail 9" + x == nn -> "Fail 10" + !(x != nn) -> "Fail 11" + 0L != ax -> "Fail 12" + 1L == ax -> "Fail 13" + !(0L == ax) -> "Fail 14" + !(1L != ax) -> "Fail 15" + x != ax -> "Fail 16" + y == ax -> "Fail 17" + !(x == ax) -> "Fail 18" + !(y != ax) -> "Fail 19" + bx != ax -> "Fail 20" + by == ax -> "Fail 21" + !(bx == ax) -> "Fail 22" + !(by != ax) -> "Fail 23" + 0L == an -> "Fail 24" + !(0L != an) -> "Fail 25" + x == an -> "Fail 26" + !(x != an) -> "Fail 27" + bx == an -> "Fail 28" + !(bx != an) -> "Fail 29" + else -> "OK" + } +} diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedShort.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedShort.kt new file mode 100644 index 00000000000..29bf73f855a --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqBoxedShort.kt @@ -0,0 +1,47 @@ +// Auto-generated by GeneratePrimitiveVsObjectEqualityTestData. Do not edit! + +val nx: Short? = 0.toShort() +val nn: Short? = null +val x: Short = 0.toShort() +val y: Short = 1.toShort() + +fun box(): String { + val ax: Short? = 0.toShort() + val an: Short? = null + val bx: Short = 0.toShort() + val by: Short = 1.toShort() + + return when { + 0.toShort() != nx -> "Fail 0" + 1.toShort() == nx -> "Fail 1" + !(0.toShort() == nx) -> "Fail 2" + !(1.toShort() != nx) -> "Fail 3" + x != nx -> "Fail 4" + y == nx -> "Fail 5" + !(x == nx) -> "Fail 6" + !(y != nx) -> "Fail 7" + 0.toShort() == nn -> "Fail 8" + !(0.toShort() != nn) -> "Fail 9" + x == nn -> "Fail 10" + !(x != nn) -> "Fail 11" + 0.toShort() != ax -> "Fail 12" + 1.toShort() == ax -> "Fail 13" + !(0.toShort() == ax) -> "Fail 14" + !(1.toShort() != ax) -> "Fail 15" + x != ax -> "Fail 16" + y == ax -> "Fail 17" + !(x == ax) -> "Fail 18" + !(y != ax) -> "Fail 19" + bx != ax -> "Fail 20" + by == ax -> "Fail 21" + !(bx == ax) -> "Fail 22" + !(by != ax) -> "Fail 23" + 0.toShort() == an -> "Fail 24" + !(0.toShort() != an) -> "Fail 25" + x == an -> "Fail 26" + !(x != an) -> "Fail 27" + bx == an -> "Fail 28" + !(bx != an) -> "Fail 29" + else -> "OK" + } +} diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectBoolean.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectBoolean.kt new file mode 100644 index 00000000000..3086b937bb9 --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectBoolean.kt @@ -0,0 +1,47 @@ +// Auto-generated by GeneratePrimitiveVsObjectEqualityTestData. Do not edit! + +val nx: Any? = true +val nn: Any? = null +val x: Boolean = true +val y: Boolean = false + +fun box(): String { + val ax: Any? = true + val an: Any? = null + val bx: Boolean = true + val by: Boolean = false + + return when { + true != nx -> "Fail 0" + false == nx -> "Fail 1" + !(true == nx) -> "Fail 2" + !(false != nx) -> "Fail 3" + x != nx -> "Fail 4" + y == nx -> "Fail 5" + !(x == nx) -> "Fail 6" + !(y != nx) -> "Fail 7" + true == nn -> "Fail 8" + !(true != nn) -> "Fail 9" + x == nn -> "Fail 10" + !(x != nn) -> "Fail 11" + true != ax -> "Fail 12" + false == ax -> "Fail 13" + !(true == ax) -> "Fail 14" + !(false != ax) -> "Fail 15" + x != ax -> "Fail 16" + y == ax -> "Fail 17" + !(x == ax) -> "Fail 18" + !(y != ax) -> "Fail 19" + bx != ax -> "Fail 20" + by == ax -> "Fail 21" + !(bx == ax) -> "Fail 22" + !(by != ax) -> "Fail 23" + true == an -> "Fail 24" + !(true != an) -> "Fail 25" + x == an -> "Fail 26" + !(x != an) -> "Fail 27" + bx == an -> "Fail 28" + !(bx != an) -> "Fail 29" + else -> "OK" + } +} diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectByte.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectByte.kt new file mode 100644 index 00000000000..b0b853c6edc --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectByte.kt @@ -0,0 +1,47 @@ +// Auto-generated by GeneratePrimitiveVsObjectEqualityTestData. Do not edit! + +val nx: Any? = 0.toByte() +val nn: Any? = null +val x: Byte = 0.toByte() +val y: Byte = 1.toByte() + +fun box(): String { + val ax: Any? = 0.toByte() + val an: Any? = null + val bx: Byte = 0.toByte() + val by: Byte = 1.toByte() + + return when { + 0.toByte() != nx -> "Fail 0" + 1.toByte() == nx -> "Fail 1" + !(0.toByte() == nx) -> "Fail 2" + !(1.toByte() != nx) -> "Fail 3" + x != nx -> "Fail 4" + y == nx -> "Fail 5" + !(x == nx) -> "Fail 6" + !(y != nx) -> "Fail 7" + 0.toByte() == nn -> "Fail 8" + !(0.toByte() != nn) -> "Fail 9" + x == nn -> "Fail 10" + !(x != nn) -> "Fail 11" + 0.toByte() != ax -> "Fail 12" + 1.toByte() == ax -> "Fail 13" + !(0.toByte() == ax) -> "Fail 14" + !(1.toByte() != ax) -> "Fail 15" + x != ax -> "Fail 16" + y == ax -> "Fail 17" + !(x == ax) -> "Fail 18" + !(y != ax) -> "Fail 19" + bx != ax -> "Fail 20" + by == ax -> "Fail 21" + !(bx == ax) -> "Fail 22" + !(by != ax) -> "Fail 23" + 0.toByte() == an -> "Fail 24" + !(0.toByte() != an) -> "Fail 25" + x == an -> "Fail 26" + !(x != an) -> "Fail 27" + bx == an -> "Fail 28" + !(bx != an) -> "Fail 29" + else -> "OK" + } +} diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectChar.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectChar.kt new file mode 100644 index 00000000000..6122439bcb6 --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectChar.kt @@ -0,0 +1,47 @@ +// Auto-generated by GeneratePrimitiveVsObjectEqualityTestData. Do not edit! + +val nx: Any? = '0' +val nn: Any? = null +val x: Char = '0' +val y: Char = '1' + +fun box(): String { + val ax: Any? = '0' + val an: Any? = null + val bx: Char = '0' + val by: Char = '1' + + return when { + '0' != nx -> "Fail 0" + '1' == nx -> "Fail 1" + !('0' == nx) -> "Fail 2" + !('1' != nx) -> "Fail 3" + x != nx -> "Fail 4" + y == nx -> "Fail 5" + !(x == nx) -> "Fail 6" + !(y != nx) -> "Fail 7" + '0' == nn -> "Fail 8" + !('0' != nn) -> "Fail 9" + x == nn -> "Fail 10" + !(x != nn) -> "Fail 11" + '0' != ax -> "Fail 12" + '1' == ax -> "Fail 13" + !('0' == ax) -> "Fail 14" + !('1' != ax) -> "Fail 15" + x != ax -> "Fail 16" + y == ax -> "Fail 17" + !(x == ax) -> "Fail 18" + !(y != ax) -> "Fail 19" + bx != ax -> "Fail 20" + by == ax -> "Fail 21" + !(bx == ax) -> "Fail 22" + !(by != ax) -> "Fail 23" + '0' == an -> "Fail 24" + !('0' != an) -> "Fail 25" + x == an -> "Fail 26" + !(x != an) -> "Fail 27" + bx == an -> "Fail 28" + !(bx != an) -> "Fail 29" + else -> "OK" + } +} diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectInt.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectInt.kt new file mode 100644 index 00000000000..a93afee14a2 --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectInt.kt @@ -0,0 +1,47 @@ +// Auto-generated by GeneratePrimitiveVsObjectEqualityTestData. Do not edit! + +val nx: Any? = 0 +val nn: Any? = null +val x: Int = 0 +val y: Int = 1 + +fun box(): String { + val ax: Any? = 0 + val an: Any? = null + val bx: Int = 0 + val by: Int = 1 + + return when { + 0 != nx -> "Fail 0" + 1 == nx -> "Fail 1" + !(0 == nx) -> "Fail 2" + !(1 != nx) -> "Fail 3" + x != nx -> "Fail 4" + y == nx -> "Fail 5" + !(x == nx) -> "Fail 6" + !(y != nx) -> "Fail 7" + 0 == nn -> "Fail 8" + !(0 != nn) -> "Fail 9" + x == nn -> "Fail 10" + !(x != nn) -> "Fail 11" + 0 != ax -> "Fail 12" + 1 == ax -> "Fail 13" + !(0 == ax) -> "Fail 14" + !(1 != ax) -> "Fail 15" + x != ax -> "Fail 16" + y == ax -> "Fail 17" + !(x == ax) -> "Fail 18" + !(y != ax) -> "Fail 19" + bx != ax -> "Fail 20" + by == ax -> "Fail 21" + !(bx == ax) -> "Fail 22" + !(by != ax) -> "Fail 23" + 0 == an -> "Fail 24" + !(0 != an) -> "Fail 25" + x == an -> "Fail 26" + !(x != an) -> "Fail 27" + bx == an -> "Fail 28" + !(bx != an) -> "Fail 29" + else -> "OK" + } +} diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectLong.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectLong.kt new file mode 100644 index 00000000000..ddfdcad82e8 --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectLong.kt @@ -0,0 +1,47 @@ +// Auto-generated by GeneratePrimitiveVsObjectEqualityTestData. Do not edit! + +val nx: Any? = 0L +val nn: Any? = null +val x: Long = 0L +val y: Long = 1L + +fun box(): String { + val ax: Any? = 0L + val an: Any? = null + val bx: Long = 0L + val by: Long = 1L + + return when { + 0L != nx -> "Fail 0" + 1L == nx -> "Fail 1" + !(0L == nx) -> "Fail 2" + !(1L != nx) -> "Fail 3" + x != nx -> "Fail 4" + y == nx -> "Fail 5" + !(x == nx) -> "Fail 6" + !(y != nx) -> "Fail 7" + 0L == nn -> "Fail 8" + !(0L != nn) -> "Fail 9" + x == nn -> "Fail 10" + !(x != nn) -> "Fail 11" + 0L != ax -> "Fail 12" + 1L == ax -> "Fail 13" + !(0L == ax) -> "Fail 14" + !(1L != ax) -> "Fail 15" + x != ax -> "Fail 16" + y == ax -> "Fail 17" + !(x == ax) -> "Fail 18" + !(y != ax) -> "Fail 19" + bx != ax -> "Fail 20" + by == ax -> "Fail 21" + !(bx == ax) -> "Fail 22" + !(by != ax) -> "Fail 23" + 0L == an -> "Fail 24" + !(0L != an) -> "Fail 25" + x == an -> "Fail 26" + !(x != an) -> "Fail 27" + bx == an -> "Fail 28" + !(bx != an) -> "Fail 29" + else -> "OK" + } +} diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectShort.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectShort.kt new file mode 100644 index 00000000000..61c27d231c0 --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/generated/primitiveEqObjectShort.kt @@ -0,0 +1,47 @@ +// Auto-generated by GeneratePrimitiveVsObjectEqualityTestData. Do not edit! + +val nx: Any? = 0.toShort() +val nn: Any? = null +val x: Short = 0.toShort() +val y: Short = 1.toShort() + +fun box(): String { + val ax: Any? = 0.toShort() + val an: Any? = null + val bx: Short = 0.toShort() + val by: Short = 1.toShort() + + return when { + 0.toShort() != nx -> "Fail 0" + 1.toShort() == nx -> "Fail 1" + !(0.toShort() == nx) -> "Fail 2" + !(1.toShort() != nx) -> "Fail 3" + x != nx -> "Fail 4" + y == nx -> "Fail 5" + !(x == nx) -> "Fail 6" + !(y != nx) -> "Fail 7" + 0.toShort() == nn -> "Fail 8" + !(0.toShort() != nn) -> "Fail 9" + x == nn -> "Fail 10" + !(x != nn) -> "Fail 11" + 0.toShort() != ax -> "Fail 12" + 1.toShort() == ax -> "Fail 13" + !(0.toShort() == ax) -> "Fail 14" + !(1.toShort() != ax) -> "Fail 15" + x != ax -> "Fail 16" + y == ax -> "Fail 17" + !(x == ax) -> "Fail 18" + !(y != ax) -> "Fail 19" + bx != ax -> "Fail 20" + by == ax -> "Fail 21" + !(bx == ax) -> "Fail 22" + !(by != ax) -> "Fail 23" + 0.toShort() == an -> "Fail 24" + !(0.toShort() != an) -> "Fail 25" + x == an -> "Fail 26" + !(x != an) -> "Fail 27" + bx == an -> "Fail 28" + !(bx != an) -> "Fail 29" + else -> "OK" + } +} diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/objectWithAsymmetricEqualsEqPrimitive.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/objectWithAsymmetricEqualsEqPrimitive.kt new file mode 100644 index 00000000000..c0426625b8b --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/objectWithAsymmetricEqualsEqPrimitive.kt @@ -0,0 +1,20 @@ +// Strictly speaking, asymmetric equals violates contract for 'Object#equals'. +// However, we don't rely on this contract so far. +class FakeInt(val value: Int) { + override fun equals(other: Any?): Boolean = + other is Int && other == value +} + +fun box(): String { + val fake: Any = FakeInt(42) + + val int1 = 1 + val int42 = 42 + + if (fake == int1) return "FakeInt(42) == 1" + if (fake != int42) return "FakeInt(42) != 42" + if (int1 == fake) return "1 == FakeInt(42)" + if (int42 == fake) return "42 == FakeInt(42)" + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/whenNullableBoxed.kt b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/whenNullableBoxed.kt new file mode 100644 index 00000000000..ff03f15417c --- /dev/null +++ b/backend.native/tests/external/codegen/box/primitiveTypes/equalityWithObject/whenNullableBoxed.kt @@ -0,0 +1,62 @@ +class CInt(val value: Int) +val nCInt3: CInt? = CInt(3) + +class CLong(val value: Long) +val nCLong3: CLong? = CLong(3) + +var subjectEvaluated: Int = 0 + +fun subject(x: T): T { + subjectEvaluated++ + return x +} + +fun doTestInt(i: Int?) = + when (subject(i)) { + null -> "null" + 0 -> "zero" + nCInt3?.value -> "three" + 42 -> "magic" + else -> "other" + } + +fun doTestLong(i: Long?) = + when (subject(i)) { + null -> "null" + 0L -> "zero" + nCLong3?.value -> "three" + 42L -> "magic" + else -> "other" + } + +fun testInt(i: Int?): String { + subjectEvaluated = 0 + val result = doTestInt(i) + if (subjectEvaluated != 1) throw AssertionError("Subject evaluated $subjectEvaluated") + return result +} + +fun testLong(i: Long?): String { + subjectEvaluated = 0 + val result = doTestLong(i) + if (subjectEvaluated != 1) throw AssertionError("Subject evaluated $subjectEvaluated") + return result +} + +fun box(): String { + return when { + testInt(null) != "null" -> "Fail testInt null" + testInt(0) != "zero" -> "Fail testInt 0" + testInt(1) != "other" -> "Fail testInt 1" + testInt(3) != "three" -> "Fail testInt 3" + testInt(42) != "magic" -> "Fail testInt 42" + + testLong(null) != "null" -> "Fail testLong null" + testLong(0L) != "zero" -> "Fail testLong 0" + testLong(1L) != "other" -> "Fail testLong 1" + testLong(3L) != "three" -> "Fail testLong 3" + testLong(42L) != "magic" -> "Fail testLong 42" + + else -> "OK" + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/properties/augmentedAssignmentsAndIncrements.kt b/backend.native/tests/external/codegen/box/properties/augmentedAssignmentsAndIncrements.kt index 0b8af84ffe1..bde3c09d5c4 100644 --- a/backend.native/tests/external/codegen/box/properties/augmentedAssignmentsAndIncrements.kt +++ b/backend.native/tests/external/codegen/box/properties/augmentedAssignmentsAndIncrements.kt @@ -1,5 +1,5 @@ // Enable when KT-14833 is fixed. -// TARGET_BACKEND: JS +// IGNORE_BACKEND: JVM import kotlin.reflect.KProperty var a = 0 diff --git a/backend.native/tests/external/codegen/box/properties/kt4383.kt b/backend.native/tests/external/codegen/box/properties/kt4383.kt index 4b26b927544..3a8d6e0a1e3 100644 --- a/backend.native/tests/external/codegen/box/properties/kt4383.kt +++ b/backend.native/tests/external/codegen/box/properties/kt4383.kt @@ -1,6 +1,3 @@ -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - import kotlin.reflect.KProperty class D { diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/accessorException.kt b/backend.native/tests/external/codegen/box/properties/lateinit/accessorException.kt index eb0db631364..8650a0fad11 100644 --- a/backend.native/tests/external/codegen/box/properties/lateinit/accessorException.kt +++ b/backend.native/tests/external/codegen/box/properties/lateinit/accessorException.kt @@ -1,6 +1,3 @@ -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - public class A { fun getMyStr(): String { diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/exceptionField.kt b/backend.native/tests/external/codegen/box/properties/lateinit/exceptionField.kt index 0c8a8eafe47..76120e7eff5 100644 --- a/backend.native/tests/external/codegen/box/properties/lateinit/exceptionField.kt +++ b/backend.native/tests/external/codegen/box/properties/lateinit/exceptionField.kt @@ -1,6 +1,3 @@ -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - class A { private lateinit var str: String diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/exceptionGetter.kt b/backend.native/tests/external/codegen/box/properties/lateinit/exceptionGetter.kt index ca12a2442db..35449a38fad 100644 --- a/backend.native/tests/external/codegen/box/properties/lateinit/exceptionGetter.kt +++ b/backend.native/tests/external/codegen/box/properties/lateinit/exceptionGetter.kt @@ -1,6 +1,3 @@ -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - class A { public lateinit var str: String } diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/emptyLhs.kt b/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/emptyLhs.kt new file mode 100644 index 00000000000..4e5c78fdc56 --- /dev/null +++ b/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/emptyLhs.kt @@ -0,0 +1,39 @@ +// WITH_RUNTIME + +package test + +class Foo { + lateinit var p: String + + fun test(): Boolean { + if (!::p.isInitialized) { + p = "OK" + return false + } + return true + } +} + +object Bar { + lateinit var p: String + + fun test(): Boolean { + if (!::p.isInitialized) { + p = "OK" + return false + } + return true + } +} + +fun box(): String { + val foo = Foo() + if (foo.test()) return "Fail 1" + if (!foo.test()) return "Fail 2" + + val bar = Bar + if (bar.test()) return "Fail 3" + if (!bar.test()) return "Fail 4" + + return bar.p +} diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/innerSubclass.kt b/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/innerSubclass.kt new file mode 100644 index 00000000000..691f6277775 --- /dev/null +++ b/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/innerSubclass.kt @@ -0,0 +1,35 @@ +// IGNORE_BACKEND: NATIVE +// LANGUAGE_VERSION: 1.2 +// WITH_RUNTIME + +open class Foo { + lateinit var bar: String + + private lateinit var baz: String + + fun test(): String { + val isBarInitialized: () -> Boolean = { this::bar.isInitialized } + if (isBarInitialized()) return "Fail 1" + bar = "bar" + if (!isBarInitialized()) return "Fail 2" + baz = "baz" + return InnerSubclass().testInner() + } + + inner class InnerSubclass : Foo() { + fun testInner(): String { + // This is access to InnerSubclass.bar which is inherited from Foo.bar + if (this::bar.isInitialized) return "Fail 3" + bar = "OK" + if (!this::bar.isInitialized) return "Fail 4" + + // This is access to Foo.bar declared lexically above + if (!this@Foo::bar.isInitialized) return "Fail 5" + return "OK" + } + } +} + +fun box(): String { + return Foo().test() +} diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/propertyImportedFromObject.kt b/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/propertyImportedFromObject.kt new file mode 100644 index 00000000000..a61d790b09a --- /dev/null +++ b/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/propertyImportedFromObject.kt @@ -0,0 +1,16 @@ +// WITH_RUNTIME +// IGNORE_BACKEND: JS + +package test + +import test.Derived.p + +open class Base(val b: Boolean) + +object Derived : Base(::p.isInitialized) { + lateinit var p: String +} + +fun box(): String { + return if (Derived.b) "Fail" else "OK" +} diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/sideEffects.kt b/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/sideEffects.kt new file mode 100644 index 00000000000..54d75bcd3b3 --- /dev/null +++ b/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/sideEffects.kt @@ -0,0 +1,21 @@ +// IGNORE_BACKEND: NATIVE +// LANGUAGE_VERSION: 1.2 +// WITH_RUNTIME + +class Foo { + lateinit var bar: String + + fun test(): String { + var state = 0 + if (run { state++; this }::bar.isInitialized) return "Fail 1" + + bar = "A" + if (!run { state++; this }::bar.isInitialized) return "Fail 3" + + return if (state == 2) "OK" else "Fail: state=$state" + } +} + +fun box(): String { + return Foo().test() +} diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/simpleIsInitialized.kt b/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/simpleIsInitialized.kt new file mode 100644 index 00000000000..a91306584e4 --- /dev/null +++ b/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/simpleIsInitialized.kt @@ -0,0 +1,36 @@ +// TARGET_BACKEND: JVM +// LANGUAGE_VERSION: 1.2 +// WITH_RUNTIME + +// FILE: J.java + +public class J { + public static void deinitialize(Foo foo) { + foo.bar = null; + } +} + +// FILE: main.kt + +class Foo { + lateinit var bar: String + + fun test(): String { + if (this::bar.isInitialized) return "Fail 1" + J.deinitialize(this) + if (this::bar.isInitialized) return "Fail 2" + + bar = "A" + if (!this::bar.isInitialized) return "Fail 3" + J.deinitialize(this) + if (this::bar.isInitialized) return "Fail 4" + + bar = "OK" + if (!this::bar.isInitialized) return "Fail 5" + return bar + } +} + +fun box(): String { + return Foo().test() +} diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/topLevelProperty.kt b/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/topLevelProperty.kt new file mode 100644 index 00000000000..fc4e774df7d --- /dev/null +++ b/backend.native/tests/external/codegen/box/properties/lateinit/isInitializedAndDeinitialize/topLevelProperty.kt @@ -0,0 +1,12 @@ +// IGNORE_BACKEND: NATIVE +// LANGUAGE_VERSION: 1.2 +// WITH_RUNTIME + +lateinit var bar: String + +fun box(): String { + if (::bar.isInitialized) return "Fail 1" + bar = "OK" + if (!::bar.isInitialized) return "Fail 2" + return bar +} diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/local/capturedLocalLateinit.kt b/backend.native/tests/external/codegen/box/properties/lateinit/local/capturedLocalLateinit.kt new file mode 100644 index 00000000000..03507ac8f5a --- /dev/null +++ b/backend.native/tests/external/codegen/box/properties/lateinit/local/capturedLocalLateinit.kt @@ -0,0 +1,11 @@ +// LANGUAGE_VERSION: 1.2 + +fun runNoInline(f: () -> Unit) = f() + +fun box(): String { + lateinit var ok: String + runNoInline { + ok = "OK" + } + return ok +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/local/localLateinit.kt b/backend.native/tests/external/codegen/box/properties/lateinit/local/localLateinit.kt new file mode 100644 index 00000000000..bb68d6f3f3e --- /dev/null +++ b/backend.native/tests/external/codegen/box/properties/lateinit/local/localLateinit.kt @@ -0,0 +1,9 @@ +// LANGUAGE_VERSION: 1.2 + +fun box(): String { + lateinit var ok: String + run { + ok = "OK" + } + return ok +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/local/uninitializedCapturedMemberAccess.kt b/backend.native/tests/external/codegen/box/properties/lateinit/local/uninitializedCapturedMemberAccess.kt new file mode 100644 index 00000000000..74fd67b08f8 --- /dev/null +++ b/backend.native/tests/external/codegen/box/properties/lateinit/local/uninitializedCapturedMemberAccess.kt @@ -0,0 +1,24 @@ +// LANGUAGE_VERSION: 1.2 +// WITH_RUNTIME +// IGNORE_BACKEND: NATIVE + +import kotlin.UninitializedPropertyAccessException + +fun runNoInline(f: () -> Unit) = f() + +fun box(): String { + lateinit var str: String + var i: Int = 0 + try { + runNoInline { + i = str.length + } + return "Should throw an exception" + } + catch (e: UninitializedPropertyAccessException) { + return "OK" + } + catch (e: Throwable) { + return "Unexpected exception: ${e::class}" + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/local/uninitializedCapturedRead.kt b/backend.native/tests/external/codegen/box/properties/lateinit/local/uninitializedCapturedRead.kt new file mode 100644 index 00000000000..450606b7f4c --- /dev/null +++ b/backend.native/tests/external/codegen/box/properties/lateinit/local/uninitializedCapturedRead.kt @@ -0,0 +1,24 @@ +// LANGUAGE_VERSION: 1.2 +// WITH_RUNTIME +// IGNORE_BACKEND: NATIVE + +import kotlin.UninitializedPropertyAccessException + +fun runNoInline(f: () -> Unit) = f() + +fun box(): String { + lateinit var str: String + var str2: String = "" + try { + runNoInline { + str2 = str + } + return "Should throw an exception" + } + catch (e: UninitializedPropertyAccessException) { + return "OK" + } + catch (e: Throwable) { + return "Unexpected exception: ${e::class}" + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/local/uninitializedMemberAccess.kt b/backend.native/tests/external/codegen/box/properties/lateinit/local/uninitializedMemberAccess.kt new file mode 100644 index 00000000000..6785487157e --- /dev/null +++ b/backend.native/tests/external/codegen/box/properties/lateinit/local/uninitializedMemberAccess.kt @@ -0,0 +1,20 @@ +// LANGUAGE_VERSION: 1.2 +// WITH_RUNTIME +// IGNORE_BACKEND: NATIVE + +import kotlin.UninitializedPropertyAccessException + +fun box(): String { + lateinit var str: String + var i: Int = 0 + try { + i = str.length + return "Should throw an exception" + } + catch (e: UninitializedPropertyAccessException) { + return "OK" + } + catch (e: Throwable) { + return "Unexpected exception: ${e::class}" + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/local/uninitializedRead.kt b/backend.native/tests/external/codegen/box/properties/lateinit/local/uninitializedRead.kt new file mode 100644 index 00000000000..cdb17a1381d --- /dev/null +++ b/backend.native/tests/external/codegen/box/properties/lateinit/local/uninitializedRead.kt @@ -0,0 +1,20 @@ +// LANGUAGE_VERSION: 1.2 +// WITH_RUNTIME +// IGNORE_BACKEND: NATIVE + +import kotlin.UninitializedPropertyAccessException + +fun box(): String { + lateinit var str: String + var str2: String = "" + try { + str2 = str + return "Should throw an exception" + } + catch (e: UninitializedPropertyAccessException) { + return "OK" + } + catch (e: Throwable) { + return "Unexpected exception: ${e::class}" + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/overrideException.kt b/backend.native/tests/external/codegen/box/properties/lateinit/overrideException.kt index 9b9ce777d53..ffc98f1f128 100644 --- a/backend.native/tests/external/codegen/box/properties/lateinit/overrideException.kt +++ b/backend.native/tests/external/codegen/box/properties/lateinit/overrideException.kt @@ -1,6 +1,3 @@ -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - interface Intf { val str: String } diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/privateSetterViaSubclass.kt b/backend.native/tests/external/codegen/box/properties/lateinit/privateSetterViaSubclass.kt new file mode 100644 index 00000000000..be73743b028 --- /dev/null +++ b/backend.native/tests/external/codegen/box/properties/lateinit/privateSetterViaSubclass.kt @@ -0,0 +1,16 @@ +open class A { + lateinit var x: String + private set + + protected fun set(value: String) { x = value } +} + +class B : A() { + fun init() { set("OK") } +} + +fun box(): String { + val b = B() + b.init() + return b.x +} diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/topLevel/accessorException.kt b/backend.native/tests/external/codegen/box/properties/lateinit/topLevel/accessorException.kt new file mode 100644 index 00000000000..8b04f78f948 --- /dev/null +++ b/backend.native/tests/external/codegen/box/properties/lateinit/topLevel/accessorException.kt @@ -0,0 +1,28 @@ +// LANGUAGE_VERSION: 1.2 +// WITH_RUNTIME +// IGNORE_BACKEND: NATIVE +// FILE: lateinit.kt +private lateinit var s: String + +object C { + fun setS(value: String) { s = value } + fun getS() = s +} + +// FILE: test.kt +import kotlin.UninitializedPropertyAccessException + +fun box(): String { + var str2: String = "" + try { + str2 = C.getS() + return "Should throw an exception" + } + catch (e: UninitializedPropertyAccessException) { + return "OK" + } + catch (e: Throwable) { + return "Unexpected exception: ${e::class}" + } + +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/topLevel/accessorForTopLevelLateinit.kt b/backend.native/tests/external/codegen/box/properties/lateinit/topLevel/accessorForTopLevelLateinit.kt new file mode 100644 index 00000000000..aca5474f004 --- /dev/null +++ b/backend.native/tests/external/codegen/box/properties/lateinit/topLevel/accessorForTopLevelLateinit.kt @@ -0,0 +1,15 @@ +// LANGUAGE_VERSION: 1.2 + +// FILE: lateinit.kt +private lateinit var s: String + +object C { + fun setS(value: String) { s = value } + fun getS() = s +} + +// FILE: test.kt +fun box(): String { + C.setS("OK") + return C.getS() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/topLevel/topLevelLateinit.kt b/backend.native/tests/external/codegen/box/properties/lateinit/topLevel/topLevelLateinit.kt new file mode 100644 index 00000000000..2eb9c779585 --- /dev/null +++ b/backend.native/tests/external/codegen/box/properties/lateinit/topLevel/topLevelLateinit.kt @@ -0,0 +1,10 @@ +// LANGUAGE_VERSION: 1.2 + +lateinit var ok: String + +fun box(): String { + run { + ok = "OK" + } + return ok +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/topLevel/uninitializedMemberAccess.kt b/backend.native/tests/external/codegen/box/properties/lateinit/topLevel/uninitializedMemberAccess.kt new file mode 100644 index 00000000000..ffdedd8745e --- /dev/null +++ b/backend.native/tests/external/codegen/box/properties/lateinit/topLevel/uninitializedMemberAccess.kt @@ -0,0 +1,21 @@ +// LANGUAGE_VERSION: 1.2 +// WITH_RUNTIME +// IGNORE_BACKEND: NATIVE + +import kotlin.UninitializedPropertyAccessException + +lateinit var str: String + +fun box(): String { + var i: Int = 0 + try { + i = str.length + return "Should throw an exception" + } + catch (e: UninitializedPropertyAccessException) { + return "OK" + } + catch (e: Throwable) { + return "Unexpected exception: ${e::class}" + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/topLevel/uninitializedRead.kt b/backend.native/tests/external/codegen/box/properties/lateinit/topLevel/uninitializedRead.kt new file mode 100644 index 00000000000..c7055a8d13c --- /dev/null +++ b/backend.native/tests/external/codegen/box/properties/lateinit/topLevel/uninitializedRead.kt @@ -0,0 +1,21 @@ +// LANGUAGE_VERSION: 1.2 +// WITH_RUNTIME +// IGNORE_BACKEND: NATIVE + +import kotlin.UninitializedPropertyAccessException + +lateinit var str: String + +fun box(): String { + var str2: String = "" + try { + str2 = str + return "Should throw an exception" + } + catch (e: UninitializedPropertyAccessException) { + return "OK" + } + catch (e: Throwable) { + return "Unexpected exception: ${e::class}" + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/properties/lateinit/visibility.kt b/backend.native/tests/external/codegen/box/properties/lateinit/visibility.kt index e2ae4d9dc1e..7773f38e555 100644 --- a/backend.native/tests/external/codegen/box/properties/lateinit/visibility.kt +++ b/backend.native/tests/external/codegen/box/properties/lateinit/visibility.kt @@ -1,6 +1,4 @@ -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS, NATIVE - +// TARGET_BACKEND: JVM // WITH_RUNTIME // FULL_JDK diff --git a/backend.native/tests/external/codegen/box/ranges/contains/comparisonWithRangeBoundEliminated.kt b/backend.native/tests/external/codegen/box/ranges/contains/comparisonWithRangeBoundEliminated.kt new file mode 100644 index 00000000000..949136655a1 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/comparisonWithRangeBoundEliminated.kt @@ -0,0 +1,23 @@ +fun abs(x: Int) = if (x < 0) -x else x +fun abs(x: Long) = if (x < 0) -x else x + +fun test1() = + 5 in abs(-1) .. 10 + +fun test2() = + 5 in 1 .. abs(-10) + +fun test3() = + 5L in abs(-1L) .. 10L + +fun test4() = + 5L in 1L .. abs(-10L) + +fun box(): String { + if (!test1()) return "Fail 1" + if (!test2()) return "Fail 2" + if (!test3()) return "Fail 3" + if (!test4()) return "Fail 4" + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/ranges/contains/evaluationOrderForCollection.kt b/backend.native/tests/external/codegen/box/ranges/contains/evaluationOrderForCollection.kt new file mode 100644 index 00000000000..64973d641bd --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/evaluationOrderForCollection.kt @@ -0,0 +1,27 @@ +// WITH_RUNTIME + +var order = StringBuilder() + +inline fun expectOrder(at: String, expected: String, body: () -> Unit) { + order = StringBuilder() // have to do that in order to run this test in JS + body() + if (order.toString() != expected) throw AssertionError("$at: expected: $expected, actual: $order") +} + +fun list(): List { + order.append("L") + return emptyList() +} + + +fun x(i: Int): Int { + order.append("X") + return i +} + +fun box(): String { + expectOrder("1 in []", "LX") { x(1) in list() } + expectOrder("1 !in []", "LX") { x(1) !in list() } + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/ranges/contains/evaluationOrderForComparableRange.kt b/backend.native/tests/external/codegen/box/ranges/contains/evaluationOrderForComparableRange.kt new file mode 100644 index 00000000000..6201cf0b728 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/evaluationOrderForComparableRange.kt @@ -0,0 +1,47 @@ +// WITH_RUNTIME + +var order = StringBuilder() + +inline fun expectOrder(at: String, expected: String, body: () -> Unit) { + order = StringBuilder() // have to do that in order to run this test in JS + body() + if (order.toString() != expected) { + throw AssertionError("$at: expected: '$expected', actual: '$order'") + } +} + +class Z(val x: Int) : Comparable { + override fun compareTo(other: Z): Int { + order.append("c:$x,${other.x} ") + return x.compareTo(other.x) + } +} + +fun z(i: Int): Z { + order.append("z:$i ") + return Z(i) +} + +fun zr(i: Int, j: Int) = z(i) .. z(j) + +fun box(): String { + expectOrder("#1", "z:1 z:3 z:0 c:0,1 ") { z(0) in z(1) .. z(3) } + expectOrder("#1a", "z:1 z:3 z:0 c:0,1 ") { z(0) in zr(1, 3) } + + expectOrder("#2", "z:1 z:3 z:2 c:2,1 c:2,3 ") { z(2) in z(1) .. z(3) } + expectOrder("#2a", "z:1 z:3 z:2 c:2,1 c:2,3 ") { z(2) in zr(1, 3) } + + expectOrder("#3", "z:1 z:3 z:4 c:4,1 c:4,3 ") { z(4) in z(1) .. z(3) } + expectOrder("#3a", "z:1 z:3 z:4 c:4,1 c:4,3 ") { z(4) in zr(1, 3) } + + expectOrder("#4", "z:1 z:3 z:0 c:0,1 ") { z(0) !in z(1) .. z(3) } + expectOrder("#4a", "z:1 z:3 z:0 c:0,1 ") { z(0) !in zr(1, 3) } + + expectOrder("#5", "z:1 z:3 z:2 c:2,1 c:2,3 ") { z(2) !in z(1) .. z(3) } + expectOrder("#5a", "z:1 z:3 z:2 c:2,1 c:2,3 ") { z(2) !in zr(1, 3) } + + expectOrder("#6", "z:1 z:3 z:4 c:4,1 c:4,3 ") { z(4) !in z(1) .. z(3) } + expectOrder("#6a", "z:1 z:3 z:4 c:4,1 c:4,3 ") { z(4) !in zr(1, 3) } + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/ranges/contains/evaluationOrderForDownTo.kt b/backend.native/tests/external/codegen/box/ranges/contains/evaluationOrderForDownTo.kt new file mode 100644 index 00000000000..433614b74aa --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/evaluationOrderForDownTo.kt @@ -0,0 +1,31 @@ +// WITH_RUNTIME + +var order = StringBuilder() + +inline fun expectOrder(at: String, expected: String, body: () -> Unit) { + order = StringBuilder() // have to do that in order to run this test in JS + body() + if (order.toString() != expected) throw AssertionError("$at: expected: $expected, actual: $order") +} + +fun low(i: Int): Int { + order.append("L") + return i +} + +fun high(i: Int): Int { + order.append("H") + return i +} + +fun x(i: Int): Int { + order.append("X") + return i +} + +fun box(): String { + expectOrder("0 in 1 .. 3", "HLX") { x(0) in high(3) downTo low(1) } + expectOrder("0 !in 1 .. 3", "HLX") { x(0) !in high(3) downTo low(1) } + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/ranges/contains/evaluationOrderForRangeLiteral.kt b/backend.native/tests/external/codegen/box/ranges/contains/evaluationOrderForRangeLiteral.kt new file mode 100644 index 00000000000..1128de60a56 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/evaluationOrderForRangeLiteral.kt @@ -0,0 +1,31 @@ +// WITH_RUNTIME + +var order = StringBuilder() + +inline fun expectOrder(at: String, expected: String, body: () -> Unit) { + order = StringBuilder() // have to do that in order to run this test in JS + body() + if (order.toString() != expected) throw AssertionError("$at: expected: $expected, actual: $order") +} + +fun low(i: Int): Int { + order.append("L") + return i +} + +fun high(i: Int): Int { + order.append("H") + return i +} + +fun x(i: Int): Int { + order.append("X") + return i +} + +fun box(): String { + expectOrder("0 in 1 .. 3", "LHX") { x(0) in low(1) .. high(3) } + expectOrder("0 !in 1 .. 3", "LHX") { x(0) !in low(1) .. high(3) } + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/ranges/contains/generated/arrayIndices.kt b/backend.native/tests/external/codegen/box/ranges/contains/generated/arrayIndices.kt new file mode 100644 index 00000000000..73f9e466828 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/generated/arrayIndices.kt @@ -0,0 +1,2071 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_RUNTIME + +val intArray = intArrayOf(1, 2, 3) +val objectArray = arrayOf(1, 2, 3) +val emptyIntArray = intArrayOf() +val emptyObjectArray = arrayOf() + +val range0 = intArray.indices +val range1 = objectArray.indices +val range2 = emptyIntArray.indices +val range3 = emptyObjectArray.indices + +val element0 = (-1).toByte() +val element1 = (-1).toShort() +val element2 = (-1) +val element3 = (-1).toLong() +val element4 = (-1).toFloat() +val element5 = (-1).toDouble() +val element6 = 0.toByte() +val element7 = 0.toShort() +val element8 = 0 +val element9 = 0.toLong() +val element10 = 0.toFloat() +val element11 = 0.toDouble() +val element12 = 1.toByte() +val element13 = 1.toShort() +val element14 = 1 +val element15 = 1.toLong() +val element16 = 1.toFloat() +val element17 = 1.toDouble() +val element18 = 2.toByte() +val element19 = 2.toShort() +val element20 = 2 +val element21 = 2.toLong() +val element22 = 2.toFloat() +val element23 = 2.toDouble() +val element24 = 3.toByte() +val element25 = 3.toShort() +val element26 = 3 +val element27 = 3.toLong() +val element28 = 3.toFloat() +val element29 = 3.toDouble() +val element30 = 4.toByte() +val element31 = 4.toShort() +val element32 = 4 +val element33 = 4.toLong() +val element34 = 4.toFloat() +val element35 = 4.toDouble() + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR0xE5() + testR0xE6() + testR0xE7() + testR0xE8() + testR0xE9() + testR0xE10() + testR0xE11() + testR0xE12() + testR0xE13() + testR0xE14() + testR0xE15() + testR0xE16() + testR0xE17() + testR0xE18() + testR0xE19() + testR0xE20() + testR0xE21() + testR0xE22() + testR0xE23() + testR0xE24() + testR0xE25() + testR0xE26() + testR0xE27() + testR0xE28() + testR0xE29() + testR0xE30() + testR0xE31() + testR0xE32() + testR0xE33() + testR0xE34() + testR0xE35() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + testR1xE5() + testR1xE6() + testR1xE7() + testR1xE8() + testR1xE9() + testR1xE10() + testR1xE11() + testR1xE12() + testR1xE13() + testR1xE14() + testR1xE15() + testR1xE16() + testR1xE17() + testR1xE18() + testR1xE19() + testR1xE20() + testR1xE21() + testR1xE22() + testR1xE23() + testR1xE24() + testR1xE25() + testR1xE26() + testR1xE27() + testR1xE28() + testR1xE29() + testR1xE30() + testR1xE31() + testR1xE32() + testR1xE33() + testR1xE34() + testR1xE35() + testR2xE0() + testR2xE1() + testR2xE2() + testR2xE3() + testR2xE4() + testR2xE5() + testR2xE6() + testR2xE7() + testR2xE8() + testR2xE9() + testR2xE10() + testR2xE11() + testR2xE12() + testR2xE13() + testR2xE14() + testR2xE15() + testR2xE16() + testR2xE17() + testR2xE18() + testR2xE19() + testR2xE20() + testR2xE21() + testR2xE22() + testR2xE23() + testR2xE24() + testR2xE25() + testR2xE26() + testR2xE27() + testR2xE28() + testR2xE29() + testR2xE30() + testR2xE31() + testR2xE32() + testR2xE33() + testR2xE34() + testR2xE35() + testR3xE0() + testR3xE1() + testR3xE2() + testR3xE3() + testR3xE4() + testR3xE5() + testR3xE6() + testR3xE7() + testR3xE8() + testR3xE9() + testR3xE10() + testR3xE11() + testR3xE12() + testR3xE13() + testR3xE14() + testR3xE15() + testR3xE16() + testR3xE17() + testR3xE18() + testR3xE19() + testR3xE20() + testR3xE21() + testR3xE22() + testR3xE23() + testR3xE24() + testR3xE25() + testR3xE26() + testR3xE27() + testR3xE28() + testR3xE29() + testR3xE30() + testR3xE31() + testR3xE32() + testR3xE33() + testR3xE34() + testR3xE35() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if ((-1).toByte() in intArray.indices != range0.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in intArray.indices != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in intArray.indices) != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in intArray.indices) != range0.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in intArray.indices != range0.contains(element0)) throw AssertionError() + if (element0 !in intArray.indices != !range0.contains(element0)) throw AssertionError() + if (!(element0 in intArray.indices) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in intArray.indices) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if ((-1).toShort() in intArray.indices != range0.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in intArray.indices != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in intArray.indices) != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in intArray.indices) != range0.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in intArray.indices != range0.contains(element1)) throw AssertionError() + if (element1 !in intArray.indices != !range0.contains(element1)) throw AssertionError() + if (!(element1 in intArray.indices) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in intArray.indices) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if ((-1) in intArray.indices != range0.contains((-1))) throw AssertionError() + if ((-1) !in intArray.indices != !range0.contains((-1))) throw AssertionError() + if (!((-1) in intArray.indices) != !range0.contains((-1))) throw AssertionError() + if (!((-1) !in intArray.indices) != range0.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in intArray.indices != range0.contains(element2)) throw AssertionError() + if (element2 !in intArray.indices != !range0.contains(element2)) throw AssertionError() + if (!(element2 in intArray.indices) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in intArray.indices) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if ((-1).toLong() in intArray.indices != range0.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in intArray.indices != !range0.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in intArray.indices) != !range0.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in intArray.indices) != range0.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in intArray.indices != range0.contains(element3)) throw AssertionError() + if (element3 !in intArray.indices != !range0.contains(element3)) throw AssertionError() + if (!(element3 in intArray.indices) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in intArray.indices) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if ((-1).toFloat() in intArray.indices != range0.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in intArray.indices != !range0.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in intArray.indices) != !range0.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in intArray.indices) != range0.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in intArray.indices != range0.contains(element4)) throw AssertionError() + if (element4 !in intArray.indices != !range0.contains(element4)) throw AssertionError() + if (!(element4 in intArray.indices) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in intArray.indices) != range0.contains(element4)) throw AssertionError() +} + +fun testR0xE5() { + // with possible local optimizations + if ((-1).toDouble() in intArray.indices != range0.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in intArray.indices != !range0.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in intArray.indices) != !range0.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in intArray.indices) != range0.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in intArray.indices != range0.contains(element5)) throw AssertionError() + if (element5 !in intArray.indices != !range0.contains(element5)) throw AssertionError() + if (!(element5 in intArray.indices) != !range0.contains(element5)) throw AssertionError() + if (!(element5 !in intArray.indices) != range0.contains(element5)) throw AssertionError() +} + +fun testR0xE6() { + // with possible local optimizations + if (0.toByte() in intArray.indices != range0.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in intArray.indices != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in intArray.indices) != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in intArray.indices) != range0.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in intArray.indices != range0.contains(element6)) throw AssertionError() + if (element6 !in intArray.indices != !range0.contains(element6)) throw AssertionError() + if (!(element6 in intArray.indices) != !range0.contains(element6)) throw AssertionError() + if (!(element6 !in intArray.indices) != range0.contains(element6)) throw AssertionError() +} + +fun testR0xE7() { + // with possible local optimizations + if (0.toShort() in intArray.indices != range0.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in intArray.indices != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in intArray.indices) != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in intArray.indices) != range0.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in intArray.indices != range0.contains(element7)) throw AssertionError() + if (element7 !in intArray.indices != !range0.contains(element7)) throw AssertionError() + if (!(element7 in intArray.indices) != !range0.contains(element7)) throw AssertionError() + if (!(element7 !in intArray.indices) != range0.contains(element7)) throw AssertionError() +} + +fun testR0xE8() { + // with possible local optimizations + if (0 in intArray.indices != range0.contains(0)) throw AssertionError() + if (0 !in intArray.indices != !range0.contains(0)) throw AssertionError() + if (!(0 in intArray.indices) != !range0.contains(0)) throw AssertionError() + if (!(0 !in intArray.indices) != range0.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in intArray.indices != range0.contains(element8)) throw AssertionError() + if (element8 !in intArray.indices != !range0.contains(element8)) throw AssertionError() + if (!(element8 in intArray.indices) != !range0.contains(element8)) throw AssertionError() + if (!(element8 !in intArray.indices) != range0.contains(element8)) throw AssertionError() +} + +fun testR0xE9() { + // with possible local optimizations + if (0.toLong() in intArray.indices != range0.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in intArray.indices != !range0.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in intArray.indices) != !range0.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in intArray.indices) != range0.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in intArray.indices != range0.contains(element9)) throw AssertionError() + if (element9 !in intArray.indices != !range0.contains(element9)) throw AssertionError() + if (!(element9 in intArray.indices) != !range0.contains(element9)) throw AssertionError() + if (!(element9 !in intArray.indices) != range0.contains(element9)) throw AssertionError() +} + +fun testR0xE10() { + // with possible local optimizations + if (0.toFloat() in intArray.indices != range0.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in intArray.indices != !range0.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in intArray.indices) != !range0.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in intArray.indices) != range0.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in intArray.indices != range0.contains(element10)) throw AssertionError() + if (element10 !in intArray.indices != !range0.contains(element10)) throw AssertionError() + if (!(element10 in intArray.indices) != !range0.contains(element10)) throw AssertionError() + if (!(element10 !in intArray.indices) != range0.contains(element10)) throw AssertionError() +} + +fun testR0xE11() { + // with possible local optimizations + if (0.toDouble() in intArray.indices != range0.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in intArray.indices != !range0.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in intArray.indices) != !range0.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in intArray.indices) != range0.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in intArray.indices != range0.contains(element11)) throw AssertionError() + if (element11 !in intArray.indices != !range0.contains(element11)) throw AssertionError() + if (!(element11 in intArray.indices) != !range0.contains(element11)) throw AssertionError() + if (!(element11 !in intArray.indices) != range0.contains(element11)) throw AssertionError() +} + +fun testR0xE12() { + // with possible local optimizations + if (1.toByte() in intArray.indices != range0.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in intArray.indices != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in intArray.indices) != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in intArray.indices) != range0.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in intArray.indices != range0.contains(element12)) throw AssertionError() + if (element12 !in intArray.indices != !range0.contains(element12)) throw AssertionError() + if (!(element12 in intArray.indices) != !range0.contains(element12)) throw AssertionError() + if (!(element12 !in intArray.indices) != range0.contains(element12)) throw AssertionError() +} + +fun testR0xE13() { + // with possible local optimizations + if (1.toShort() in intArray.indices != range0.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in intArray.indices != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in intArray.indices) != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in intArray.indices) != range0.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in intArray.indices != range0.contains(element13)) throw AssertionError() + if (element13 !in intArray.indices != !range0.contains(element13)) throw AssertionError() + if (!(element13 in intArray.indices) != !range0.contains(element13)) throw AssertionError() + if (!(element13 !in intArray.indices) != range0.contains(element13)) throw AssertionError() +} + +fun testR0xE14() { + // with possible local optimizations + if (1 in intArray.indices != range0.contains(1)) throw AssertionError() + if (1 !in intArray.indices != !range0.contains(1)) throw AssertionError() + if (!(1 in intArray.indices) != !range0.contains(1)) throw AssertionError() + if (!(1 !in intArray.indices) != range0.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in intArray.indices != range0.contains(element14)) throw AssertionError() + if (element14 !in intArray.indices != !range0.contains(element14)) throw AssertionError() + if (!(element14 in intArray.indices) != !range0.contains(element14)) throw AssertionError() + if (!(element14 !in intArray.indices) != range0.contains(element14)) throw AssertionError() +} + +fun testR0xE15() { + // with possible local optimizations + if (1.toLong() in intArray.indices != range0.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in intArray.indices != !range0.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in intArray.indices) != !range0.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in intArray.indices) != range0.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in intArray.indices != range0.contains(element15)) throw AssertionError() + if (element15 !in intArray.indices != !range0.contains(element15)) throw AssertionError() + if (!(element15 in intArray.indices) != !range0.contains(element15)) throw AssertionError() + if (!(element15 !in intArray.indices) != range0.contains(element15)) throw AssertionError() +} + +fun testR0xE16() { + // with possible local optimizations + if (1.toFloat() in intArray.indices != range0.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in intArray.indices != !range0.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in intArray.indices) != !range0.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in intArray.indices) != range0.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in intArray.indices != range0.contains(element16)) throw AssertionError() + if (element16 !in intArray.indices != !range0.contains(element16)) throw AssertionError() + if (!(element16 in intArray.indices) != !range0.contains(element16)) throw AssertionError() + if (!(element16 !in intArray.indices) != range0.contains(element16)) throw AssertionError() +} + +fun testR0xE17() { + // with possible local optimizations + if (1.toDouble() in intArray.indices != range0.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in intArray.indices != !range0.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in intArray.indices) != !range0.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in intArray.indices) != range0.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in intArray.indices != range0.contains(element17)) throw AssertionError() + if (element17 !in intArray.indices != !range0.contains(element17)) throw AssertionError() + if (!(element17 in intArray.indices) != !range0.contains(element17)) throw AssertionError() + if (!(element17 !in intArray.indices) != range0.contains(element17)) throw AssertionError() +} + +fun testR0xE18() { + // with possible local optimizations + if (2.toByte() in intArray.indices != range0.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in intArray.indices != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in intArray.indices) != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in intArray.indices) != range0.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in intArray.indices != range0.contains(element18)) throw AssertionError() + if (element18 !in intArray.indices != !range0.contains(element18)) throw AssertionError() + if (!(element18 in intArray.indices) != !range0.contains(element18)) throw AssertionError() + if (!(element18 !in intArray.indices) != range0.contains(element18)) throw AssertionError() +} + +fun testR0xE19() { + // with possible local optimizations + if (2.toShort() in intArray.indices != range0.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in intArray.indices != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in intArray.indices) != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in intArray.indices) != range0.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in intArray.indices != range0.contains(element19)) throw AssertionError() + if (element19 !in intArray.indices != !range0.contains(element19)) throw AssertionError() + if (!(element19 in intArray.indices) != !range0.contains(element19)) throw AssertionError() + if (!(element19 !in intArray.indices) != range0.contains(element19)) throw AssertionError() +} + +fun testR0xE20() { + // with possible local optimizations + if (2 in intArray.indices != range0.contains(2)) throw AssertionError() + if (2 !in intArray.indices != !range0.contains(2)) throw AssertionError() + if (!(2 in intArray.indices) != !range0.contains(2)) throw AssertionError() + if (!(2 !in intArray.indices) != range0.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in intArray.indices != range0.contains(element20)) throw AssertionError() + if (element20 !in intArray.indices != !range0.contains(element20)) throw AssertionError() + if (!(element20 in intArray.indices) != !range0.contains(element20)) throw AssertionError() + if (!(element20 !in intArray.indices) != range0.contains(element20)) throw AssertionError() +} + +fun testR0xE21() { + // with possible local optimizations + if (2.toLong() in intArray.indices != range0.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in intArray.indices != !range0.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in intArray.indices) != !range0.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in intArray.indices) != range0.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in intArray.indices != range0.contains(element21)) throw AssertionError() + if (element21 !in intArray.indices != !range0.contains(element21)) throw AssertionError() + if (!(element21 in intArray.indices) != !range0.contains(element21)) throw AssertionError() + if (!(element21 !in intArray.indices) != range0.contains(element21)) throw AssertionError() +} + +fun testR0xE22() { + // with possible local optimizations + if (2.toFloat() in intArray.indices != range0.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in intArray.indices != !range0.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in intArray.indices) != !range0.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in intArray.indices) != range0.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in intArray.indices != range0.contains(element22)) throw AssertionError() + if (element22 !in intArray.indices != !range0.contains(element22)) throw AssertionError() + if (!(element22 in intArray.indices) != !range0.contains(element22)) throw AssertionError() + if (!(element22 !in intArray.indices) != range0.contains(element22)) throw AssertionError() +} + +fun testR0xE23() { + // with possible local optimizations + if (2.toDouble() in intArray.indices != range0.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in intArray.indices != !range0.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in intArray.indices) != !range0.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in intArray.indices) != range0.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in intArray.indices != range0.contains(element23)) throw AssertionError() + if (element23 !in intArray.indices != !range0.contains(element23)) throw AssertionError() + if (!(element23 in intArray.indices) != !range0.contains(element23)) throw AssertionError() + if (!(element23 !in intArray.indices) != range0.contains(element23)) throw AssertionError() +} + +fun testR0xE24() { + // with possible local optimizations + if (3.toByte() in intArray.indices != range0.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in intArray.indices != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in intArray.indices) != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in intArray.indices) != range0.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in intArray.indices != range0.contains(element24)) throw AssertionError() + if (element24 !in intArray.indices != !range0.contains(element24)) throw AssertionError() + if (!(element24 in intArray.indices) != !range0.contains(element24)) throw AssertionError() + if (!(element24 !in intArray.indices) != range0.contains(element24)) throw AssertionError() +} + +fun testR0xE25() { + // with possible local optimizations + if (3.toShort() in intArray.indices != range0.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in intArray.indices != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in intArray.indices) != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in intArray.indices) != range0.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in intArray.indices != range0.contains(element25)) throw AssertionError() + if (element25 !in intArray.indices != !range0.contains(element25)) throw AssertionError() + if (!(element25 in intArray.indices) != !range0.contains(element25)) throw AssertionError() + if (!(element25 !in intArray.indices) != range0.contains(element25)) throw AssertionError() +} + +fun testR0xE26() { + // with possible local optimizations + if (3 in intArray.indices != range0.contains(3)) throw AssertionError() + if (3 !in intArray.indices != !range0.contains(3)) throw AssertionError() + if (!(3 in intArray.indices) != !range0.contains(3)) throw AssertionError() + if (!(3 !in intArray.indices) != range0.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in intArray.indices != range0.contains(element26)) throw AssertionError() + if (element26 !in intArray.indices != !range0.contains(element26)) throw AssertionError() + if (!(element26 in intArray.indices) != !range0.contains(element26)) throw AssertionError() + if (!(element26 !in intArray.indices) != range0.contains(element26)) throw AssertionError() +} + +fun testR0xE27() { + // with possible local optimizations + if (3.toLong() in intArray.indices != range0.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in intArray.indices != !range0.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in intArray.indices) != !range0.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in intArray.indices) != range0.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in intArray.indices != range0.contains(element27)) throw AssertionError() + if (element27 !in intArray.indices != !range0.contains(element27)) throw AssertionError() + if (!(element27 in intArray.indices) != !range0.contains(element27)) throw AssertionError() + if (!(element27 !in intArray.indices) != range0.contains(element27)) throw AssertionError() +} + +fun testR0xE28() { + // with possible local optimizations + if (3.toFloat() in intArray.indices != range0.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in intArray.indices != !range0.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in intArray.indices) != !range0.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in intArray.indices) != range0.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in intArray.indices != range0.contains(element28)) throw AssertionError() + if (element28 !in intArray.indices != !range0.contains(element28)) throw AssertionError() + if (!(element28 in intArray.indices) != !range0.contains(element28)) throw AssertionError() + if (!(element28 !in intArray.indices) != range0.contains(element28)) throw AssertionError() +} + +fun testR0xE29() { + // with possible local optimizations + if (3.toDouble() in intArray.indices != range0.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in intArray.indices != !range0.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in intArray.indices) != !range0.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in intArray.indices) != range0.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in intArray.indices != range0.contains(element29)) throw AssertionError() + if (element29 !in intArray.indices != !range0.contains(element29)) throw AssertionError() + if (!(element29 in intArray.indices) != !range0.contains(element29)) throw AssertionError() + if (!(element29 !in intArray.indices) != range0.contains(element29)) throw AssertionError() +} + +fun testR0xE30() { + // with possible local optimizations + if (4.toByte() in intArray.indices != range0.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in intArray.indices != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in intArray.indices) != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in intArray.indices) != range0.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in intArray.indices != range0.contains(element30)) throw AssertionError() + if (element30 !in intArray.indices != !range0.contains(element30)) throw AssertionError() + if (!(element30 in intArray.indices) != !range0.contains(element30)) throw AssertionError() + if (!(element30 !in intArray.indices) != range0.contains(element30)) throw AssertionError() +} + +fun testR0xE31() { + // with possible local optimizations + if (4.toShort() in intArray.indices != range0.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in intArray.indices != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in intArray.indices) != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in intArray.indices) != range0.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in intArray.indices != range0.contains(element31)) throw AssertionError() + if (element31 !in intArray.indices != !range0.contains(element31)) throw AssertionError() + if (!(element31 in intArray.indices) != !range0.contains(element31)) throw AssertionError() + if (!(element31 !in intArray.indices) != range0.contains(element31)) throw AssertionError() +} + +fun testR0xE32() { + // with possible local optimizations + if (4 in intArray.indices != range0.contains(4)) throw AssertionError() + if (4 !in intArray.indices != !range0.contains(4)) throw AssertionError() + if (!(4 in intArray.indices) != !range0.contains(4)) throw AssertionError() + if (!(4 !in intArray.indices) != range0.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in intArray.indices != range0.contains(element32)) throw AssertionError() + if (element32 !in intArray.indices != !range0.contains(element32)) throw AssertionError() + if (!(element32 in intArray.indices) != !range0.contains(element32)) throw AssertionError() + if (!(element32 !in intArray.indices) != range0.contains(element32)) throw AssertionError() +} + +fun testR0xE33() { + // with possible local optimizations + if (4.toLong() in intArray.indices != range0.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in intArray.indices != !range0.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in intArray.indices) != !range0.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in intArray.indices) != range0.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in intArray.indices != range0.contains(element33)) throw AssertionError() + if (element33 !in intArray.indices != !range0.contains(element33)) throw AssertionError() + if (!(element33 in intArray.indices) != !range0.contains(element33)) throw AssertionError() + if (!(element33 !in intArray.indices) != range0.contains(element33)) throw AssertionError() +} + +fun testR0xE34() { + // with possible local optimizations + if (4.toFloat() in intArray.indices != range0.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in intArray.indices != !range0.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in intArray.indices) != !range0.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in intArray.indices) != range0.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in intArray.indices != range0.contains(element34)) throw AssertionError() + if (element34 !in intArray.indices != !range0.contains(element34)) throw AssertionError() + if (!(element34 in intArray.indices) != !range0.contains(element34)) throw AssertionError() + if (!(element34 !in intArray.indices) != range0.contains(element34)) throw AssertionError() +} + +fun testR0xE35() { + // with possible local optimizations + if (4.toDouble() in intArray.indices != range0.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in intArray.indices != !range0.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in intArray.indices) != !range0.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in intArray.indices) != range0.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in intArray.indices != range0.contains(element35)) throw AssertionError() + if (element35 !in intArray.indices != !range0.contains(element35)) throw AssertionError() + if (!(element35 in intArray.indices) != !range0.contains(element35)) throw AssertionError() + if (!(element35 !in intArray.indices) != range0.contains(element35)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if ((-1).toByte() in objectArray.indices != range1.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in objectArray.indices != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in objectArray.indices) != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in objectArray.indices) != range1.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in objectArray.indices != range1.contains(element0)) throw AssertionError() + if (element0 !in objectArray.indices != !range1.contains(element0)) throw AssertionError() + if (!(element0 in objectArray.indices) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in objectArray.indices) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if ((-1).toShort() in objectArray.indices != range1.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in objectArray.indices != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in objectArray.indices) != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in objectArray.indices) != range1.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in objectArray.indices != range1.contains(element1)) throw AssertionError() + if (element1 !in objectArray.indices != !range1.contains(element1)) throw AssertionError() + if (!(element1 in objectArray.indices) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in objectArray.indices) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if ((-1) in objectArray.indices != range1.contains((-1))) throw AssertionError() + if ((-1) !in objectArray.indices != !range1.contains((-1))) throw AssertionError() + if (!((-1) in objectArray.indices) != !range1.contains((-1))) throw AssertionError() + if (!((-1) !in objectArray.indices) != range1.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in objectArray.indices != range1.contains(element2)) throw AssertionError() + if (element2 !in objectArray.indices != !range1.contains(element2)) throw AssertionError() + if (!(element2 in objectArray.indices) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in objectArray.indices) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if ((-1).toLong() in objectArray.indices != range1.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in objectArray.indices != !range1.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in objectArray.indices) != !range1.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in objectArray.indices) != range1.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in objectArray.indices != range1.contains(element3)) throw AssertionError() + if (element3 !in objectArray.indices != !range1.contains(element3)) throw AssertionError() + if (!(element3 in objectArray.indices) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in objectArray.indices) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if ((-1).toFloat() in objectArray.indices != range1.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in objectArray.indices != !range1.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in objectArray.indices) != !range1.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in objectArray.indices) != range1.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in objectArray.indices != range1.contains(element4)) throw AssertionError() + if (element4 !in objectArray.indices != !range1.contains(element4)) throw AssertionError() + if (!(element4 in objectArray.indices) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in objectArray.indices) != range1.contains(element4)) throw AssertionError() +} + +fun testR1xE5() { + // with possible local optimizations + if ((-1).toDouble() in objectArray.indices != range1.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in objectArray.indices != !range1.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in objectArray.indices) != !range1.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in objectArray.indices) != range1.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in objectArray.indices != range1.contains(element5)) throw AssertionError() + if (element5 !in objectArray.indices != !range1.contains(element5)) throw AssertionError() + if (!(element5 in objectArray.indices) != !range1.contains(element5)) throw AssertionError() + if (!(element5 !in objectArray.indices) != range1.contains(element5)) throw AssertionError() +} + +fun testR1xE6() { + // with possible local optimizations + if (0.toByte() in objectArray.indices != range1.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in objectArray.indices != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in objectArray.indices) != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in objectArray.indices) != range1.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in objectArray.indices != range1.contains(element6)) throw AssertionError() + if (element6 !in objectArray.indices != !range1.contains(element6)) throw AssertionError() + if (!(element6 in objectArray.indices) != !range1.contains(element6)) throw AssertionError() + if (!(element6 !in objectArray.indices) != range1.contains(element6)) throw AssertionError() +} + +fun testR1xE7() { + // with possible local optimizations + if (0.toShort() in objectArray.indices != range1.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in objectArray.indices != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in objectArray.indices) != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in objectArray.indices) != range1.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in objectArray.indices != range1.contains(element7)) throw AssertionError() + if (element7 !in objectArray.indices != !range1.contains(element7)) throw AssertionError() + if (!(element7 in objectArray.indices) != !range1.contains(element7)) throw AssertionError() + if (!(element7 !in objectArray.indices) != range1.contains(element7)) throw AssertionError() +} + +fun testR1xE8() { + // with possible local optimizations + if (0 in objectArray.indices != range1.contains(0)) throw AssertionError() + if (0 !in objectArray.indices != !range1.contains(0)) throw AssertionError() + if (!(0 in objectArray.indices) != !range1.contains(0)) throw AssertionError() + if (!(0 !in objectArray.indices) != range1.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in objectArray.indices != range1.contains(element8)) throw AssertionError() + if (element8 !in objectArray.indices != !range1.contains(element8)) throw AssertionError() + if (!(element8 in objectArray.indices) != !range1.contains(element8)) throw AssertionError() + if (!(element8 !in objectArray.indices) != range1.contains(element8)) throw AssertionError() +} + +fun testR1xE9() { + // with possible local optimizations + if (0.toLong() in objectArray.indices != range1.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in objectArray.indices != !range1.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in objectArray.indices) != !range1.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in objectArray.indices) != range1.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in objectArray.indices != range1.contains(element9)) throw AssertionError() + if (element9 !in objectArray.indices != !range1.contains(element9)) throw AssertionError() + if (!(element9 in objectArray.indices) != !range1.contains(element9)) throw AssertionError() + if (!(element9 !in objectArray.indices) != range1.contains(element9)) throw AssertionError() +} + +fun testR1xE10() { + // with possible local optimizations + if (0.toFloat() in objectArray.indices != range1.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in objectArray.indices != !range1.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in objectArray.indices) != !range1.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in objectArray.indices) != range1.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in objectArray.indices != range1.contains(element10)) throw AssertionError() + if (element10 !in objectArray.indices != !range1.contains(element10)) throw AssertionError() + if (!(element10 in objectArray.indices) != !range1.contains(element10)) throw AssertionError() + if (!(element10 !in objectArray.indices) != range1.contains(element10)) throw AssertionError() +} + +fun testR1xE11() { + // with possible local optimizations + if (0.toDouble() in objectArray.indices != range1.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in objectArray.indices != !range1.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in objectArray.indices) != !range1.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in objectArray.indices) != range1.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in objectArray.indices != range1.contains(element11)) throw AssertionError() + if (element11 !in objectArray.indices != !range1.contains(element11)) throw AssertionError() + if (!(element11 in objectArray.indices) != !range1.contains(element11)) throw AssertionError() + if (!(element11 !in objectArray.indices) != range1.contains(element11)) throw AssertionError() +} + +fun testR1xE12() { + // with possible local optimizations + if (1.toByte() in objectArray.indices != range1.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in objectArray.indices != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in objectArray.indices) != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in objectArray.indices) != range1.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in objectArray.indices != range1.contains(element12)) throw AssertionError() + if (element12 !in objectArray.indices != !range1.contains(element12)) throw AssertionError() + if (!(element12 in objectArray.indices) != !range1.contains(element12)) throw AssertionError() + if (!(element12 !in objectArray.indices) != range1.contains(element12)) throw AssertionError() +} + +fun testR1xE13() { + // with possible local optimizations + if (1.toShort() in objectArray.indices != range1.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in objectArray.indices != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in objectArray.indices) != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in objectArray.indices) != range1.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in objectArray.indices != range1.contains(element13)) throw AssertionError() + if (element13 !in objectArray.indices != !range1.contains(element13)) throw AssertionError() + if (!(element13 in objectArray.indices) != !range1.contains(element13)) throw AssertionError() + if (!(element13 !in objectArray.indices) != range1.contains(element13)) throw AssertionError() +} + +fun testR1xE14() { + // with possible local optimizations + if (1 in objectArray.indices != range1.contains(1)) throw AssertionError() + if (1 !in objectArray.indices != !range1.contains(1)) throw AssertionError() + if (!(1 in objectArray.indices) != !range1.contains(1)) throw AssertionError() + if (!(1 !in objectArray.indices) != range1.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in objectArray.indices != range1.contains(element14)) throw AssertionError() + if (element14 !in objectArray.indices != !range1.contains(element14)) throw AssertionError() + if (!(element14 in objectArray.indices) != !range1.contains(element14)) throw AssertionError() + if (!(element14 !in objectArray.indices) != range1.contains(element14)) throw AssertionError() +} + +fun testR1xE15() { + // with possible local optimizations + if (1.toLong() in objectArray.indices != range1.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in objectArray.indices != !range1.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in objectArray.indices) != !range1.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in objectArray.indices) != range1.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in objectArray.indices != range1.contains(element15)) throw AssertionError() + if (element15 !in objectArray.indices != !range1.contains(element15)) throw AssertionError() + if (!(element15 in objectArray.indices) != !range1.contains(element15)) throw AssertionError() + if (!(element15 !in objectArray.indices) != range1.contains(element15)) throw AssertionError() +} + +fun testR1xE16() { + // with possible local optimizations + if (1.toFloat() in objectArray.indices != range1.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in objectArray.indices != !range1.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in objectArray.indices) != !range1.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in objectArray.indices) != range1.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in objectArray.indices != range1.contains(element16)) throw AssertionError() + if (element16 !in objectArray.indices != !range1.contains(element16)) throw AssertionError() + if (!(element16 in objectArray.indices) != !range1.contains(element16)) throw AssertionError() + if (!(element16 !in objectArray.indices) != range1.contains(element16)) throw AssertionError() +} + +fun testR1xE17() { + // with possible local optimizations + if (1.toDouble() in objectArray.indices != range1.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in objectArray.indices != !range1.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in objectArray.indices) != !range1.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in objectArray.indices) != range1.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in objectArray.indices != range1.contains(element17)) throw AssertionError() + if (element17 !in objectArray.indices != !range1.contains(element17)) throw AssertionError() + if (!(element17 in objectArray.indices) != !range1.contains(element17)) throw AssertionError() + if (!(element17 !in objectArray.indices) != range1.contains(element17)) throw AssertionError() +} + +fun testR1xE18() { + // with possible local optimizations + if (2.toByte() in objectArray.indices != range1.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in objectArray.indices != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in objectArray.indices) != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in objectArray.indices) != range1.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in objectArray.indices != range1.contains(element18)) throw AssertionError() + if (element18 !in objectArray.indices != !range1.contains(element18)) throw AssertionError() + if (!(element18 in objectArray.indices) != !range1.contains(element18)) throw AssertionError() + if (!(element18 !in objectArray.indices) != range1.contains(element18)) throw AssertionError() +} + +fun testR1xE19() { + // with possible local optimizations + if (2.toShort() in objectArray.indices != range1.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in objectArray.indices != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in objectArray.indices) != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in objectArray.indices) != range1.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in objectArray.indices != range1.contains(element19)) throw AssertionError() + if (element19 !in objectArray.indices != !range1.contains(element19)) throw AssertionError() + if (!(element19 in objectArray.indices) != !range1.contains(element19)) throw AssertionError() + if (!(element19 !in objectArray.indices) != range1.contains(element19)) throw AssertionError() +} + +fun testR1xE20() { + // with possible local optimizations + if (2 in objectArray.indices != range1.contains(2)) throw AssertionError() + if (2 !in objectArray.indices != !range1.contains(2)) throw AssertionError() + if (!(2 in objectArray.indices) != !range1.contains(2)) throw AssertionError() + if (!(2 !in objectArray.indices) != range1.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in objectArray.indices != range1.contains(element20)) throw AssertionError() + if (element20 !in objectArray.indices != !range1.contains(element20)) throw AssertionError() + if (!(element20 in objectArray.indices) != !range1.contains(element20)) throw AssertionError() + if (!(element20 !in objectArray.indices) != range1.contains(element20)) throw AssertionError() +} + +fun testR1xE21() { + // with possible local optimizations + if (2.toLong() in objectArray.indices != range1.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in objectArray.indices != !range1.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in objectArray.indices) != !range1.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in objectArray.indices) != range1.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in objectArray.indices != range1.contains(element21)) throw AssertionError() + if (element21 !in objectArray.indices != !range1.contains(element21)) throw AssertionError() + if (!(element21 in objectArray.indices) != !range1.contains(element21)) throw AssertionError() + if (!(element21 !in objectArray.indices) != range1.contains(element21)) throw AssertionError() +} + +fun testR1xE22() { + // with possible local optimizations + if (2.toFloat() in objectArray.indices != range1.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in objectArray.indices != !range1.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in objectArray.indices) != !range1.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in objectArray.indices) != range1.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in objectArray.indices != range1.contains(element22)) throw AssertionError() + if (element22 !in objectArray.indices != !range1.contains(element22)) throw AssertionError() + if (!(element22 in objectArray.indices) != !range1.contains(element22)) throw AssertionError() + if (!(element22 !in objectArray.indices) != range1.contains(element22)) throw AssertionError() +} + +fun testR1xE23() { + // with possible local optimizations + if (2.toDouble() in objectArray.indices != range1.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in objectArray.indices != !range1.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in objectArray.indices) != !range1.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in objectArray.indices) != range1.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in objectArray.indices != range1.contains(element23)) throw AssertionError() + if (element23 !in objectArray.indices != !range1.contains(element23)) throw AssertionError() + if (!(element23 in objectArray.indices) != !range1.contains(element23)) throw AssertionError() + if (!(element23 !in objectArray.indices) != range1.contains(element23)) throw AssertionError() +} + +fun testR1xE24() { + // with possible local optimizations + if (3.toByte() in objectArray.indices != range1.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in objectArray.indices != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in objectArray.indices) != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in objectArray.indices) != range1.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in objectArray.indices != range1.contains(element24)) throw AssertionError() + if (element24 !in objectArray.indices != !range1.contains(element24)) throw AssertionError() + if (!(element24 in objectArray.indices) != !range1.contains(element24)) throw AssertionError() + if (!(element24 !in objectArray.indices) != range1.contains(element24)) throw AssertionError() +} + +fun testR1xE25() { + // with possible local optimizations + if (3.toShort() in objectArray.indices != range1.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in objectArray.indices != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in objectArray.indices) != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in objectArray.indices) != range1.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in objectArray.indices != range1.contains(element25)) throw AssertionError() + if (element25 !in objectArray.indices != !range1.contains(element25)) throw AssertionError() + if (!(element25 in objectArray.indices) != !range1.contains(element25)) throw AssertionError() + if (!(element25 !in objectArray.indices) != range1.contains(element25)) throw AssertionError() +} + +fun testR1xE26() { + // with possible local optimizations + if (3 in objectArray.indices != range1.contains(3)) throw AssertionError() + if (3 !in objectArray.indices != !range1.contains(3)) throw AssertionError() + if (!(3 in objectArray.indices) != !range1.contains(3)) throw AssertionError() + if (!(3 !in objectArray.indices) != range1.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in objectArray.indices != range1.contains(element26)) throw AssertionError() + if (element26 !in objectArray.indices != !range1.contains(element26)) throw AssertionError() + if (!(element26 in objectArray.indices) != !range1.contains(element26)) throw AssertionError() + if (!(element26 !in objectArray.indices) != range1.contains(element26)) throw AssertionError() +} + +fun testR1xE27() { + // with possible local optimizations + if (3.toLong() in objectArray.indices != range1.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in objectArray.indices != !range1.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in objectArray.indices) != !range1.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in objectArray.indices) != range1.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in objectArray.indices != range1.contains(element27)) throw AssertionError() + if (element27 !in objectArray.indices != !range1.contains(element27)) throw AssertionError() + if (!(element27 in objectArray.indices) != !range1.contains(element27)) throw AssertionError() + if (!(element27 !in objectArray.indices) != range1.contains(element27)) throw AssertionError() +} + +fun testR1xE28() { + // with possible local optimizations + if (3.toFloat() in objectArray.indices != range1.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in objectArray.indices != !range1.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in objectArray.indices) != !range1.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in objectArray.indices) != range1.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in objectArray.indices != range1.contains(element28)) throw AssertionError() + if (element28 !in objectArray.indices != !range1.contains(element28)) throw AssertionError() + if (!(element28 in objectArray.indices) != !range1.contains(element28)) throw AssertionError() + if (!(element28 !in objectArray.indices) != range1.contains(element28)) throw AssertionError() +} + +fun testR1xE29() { + // with possible local optimizations + if (3.toDouble() in objectArray.indices != range1.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in objectArray.indices != !range1.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in objectArray.indices) != !range1.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in objectArray.indices) != range1.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in objectArray.indices != range1.contains(element29)) throw AssertionError() + if (element29 !in objectArray.indices != !range1.contains(element29)) throw AssertionError() + if (!(element29 in objectArray.indices) != !range1.contains(element29)) throw AssertionError() + if (!(element29 !in objectArray.indices) != range1.contains(element29)) throw AssertionError() +} + +fun testR1xE30() { + // with possible local optimizations + if (4.toByte() in objectArray.indices != range1.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in objectArray.indices != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in objectArray.indices) != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in objectArray.indices) != range1.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in objectArray.indices != range1.contains(element30)) throw AssertionError() + if (element30 !in objectArray.indices != !range1.contains(element30)) throw AssertionError() + if (!(element30 in objectArray.indices) != !range1.contains(element30)) throw AssertionError() + if (!(element30 !in objectArray.indices) != range1.contains(element30)) throw AssertionError() +} + +fun testR1xE31() { + // with possible local optimizations + if (4.toShort() in objectArray.indices != range1.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in objectArray.indices != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in objectArray.indices) != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in objectArray.indices) != range1.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in objectArray.indices != range1.contains(element31)) throw AssertionError() + if (element31 !in objectArray.indices != !range1.contains(element31)) throw AssertionError() + if (!(element31 in objectArray.indices) != !range1.contains(element31)) throw AssertionError() + if (!(element31 !in objectArray.indices) != range1.contains(element31)) throw AssertionError() +} + +fun testR1xE32() { + // with possible local optimizations + if (4 in objectArray.indices != range1.contains(4)) throw AssertionError() + if (4 !in objectArray.indices != !range1.contains(4)) throw AssertionError() + if (!(4 in objectArray.indices) != !range1.contains(4)) throw AssertionError() + if (!(4 !in objectArray.indices) != range1.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in objectArray.indices != range1.contains(element32)) throw AssertionError() + if (element32 !in objectArray.indices != !range1.contains(element32)) throw AssertionError() + if (!(element32 in objectArray.indices) != !range1.contains(element32)) throw AssertionError() + if (!(element32 !in objectArray.indices) != range1.contains(element32)) throw AssertionError() +} + +fun testR1xE33() { + // with possible local optimizations + if (4.toLong() in objectArray.indices != range1.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in objectArray.indices != !range1.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in objectArray.indices) != !range1.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in objectArray.indices) != range1.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in objectArray.indices != range1.contains(element33)) throw AssertionError() + if (element33 !in objectArray.indices != !range1.contains(element33)) throw AssertionError() + if (!(element33 in objectArray.indices) != !range1.contains(element33)) throw AssertionError() + if (!(element33 !in objectArray.indices) != range1.contains(element33)) throw AssertionError() +} + +fun testR1xE34() { + // with possible local optimizations + if (4.toFloat() in objectArray.indices != range1.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in objectArray.indices != !range1.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in objectArray.indices) != !range1.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in objectArray.indices) != range1.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in objectArray.indices != range1.contains(element34)) throw AssertionError() + if (element34 !in objectArray.indices != !range1.contains(element34)) throw AssertionError() + if (!(element34 in objectArray.indices) != !range1.contains(element34)) throw AssertionError() + if (!(element34 !in objectArray.indices) != range1.contains(element34)) throw AssertionError() +} + +fun testR1xE35() { + // with possible local optimizations + if (4.toDouble() in objectArray.indices != range1.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in objectArray.indices != !range1.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in objectArray.indices) != !range1.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in objectArray.indices) != range1.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in objectArray.indices != range1.contains(element35)) throw AssertionError() + if (element35 !in objectArray.indices != !range1.contains(element35)) throw AssertionError() + if (!(element35 in objectArray.indices) != !range1.contains(element35)) throw AssertionError() + if (!(element35 !in objectArray.indices) != range1.contains(element35)) throw AssertionError() +} + +fun testR2xE0() { + // with possible local optimizations + if ((-1).toByte() in emptyIntArray.indices != range2.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in emptyIntArray.indices != !range2.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in emptyIntArray.indices) != !range2.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in emptyIntArray.indices) != range2.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in emptyIntArray.indices != range2.contains(element0)) throw AssertionError() + if (element0 !in emptyIntArray.indices != !range2.contains(element0)) throw AssertionError() + if (!(element0 in emptyIntArray.indices) != !range2.contains(element0)) throw AssertionError() + if (!(element0 !in emptyIntArray.indices) != range2.contains(element0)) throw AssertionError() +} + +fun testR2xE1() { + // with possible local optimizations + if ((-1).toShort() in emptyIntArray.indices != range2.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in emptyIntArray.indices != !range2.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in emptyIntArray.indices) != !range2.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in emptyIntArray.indices) != range2.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in emptyIntArray.indices != range2.contains(element1)) throw AssertionError() + if (element1 !in emptyIntArray.indices != !range2.contains(element1)) throw AssertionError() + if (!(element1 in emptyIntArray.indices) != !range2.contains(element1)) throw AssertionError() + if (!(element1 !in emptyIntArray.indices) != range2.contains(element1)) throw AssertionError() +} + +fun testR2xE2() { + // with possible local optimizations + if ((-1) in emptyIntArray.indices != range2.contains((-1))) throw AssertionError() + if ((-1) !in emptyIntArray.indices != !range2.contains((-1))) throw AssertionError() + if (!((-1) in emptyIntArray.indices) != !range2.contains((-1))) throw AssertionError() + if (!((-1) !in emptyIntArray.indices) != range2.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in emptyIntArray.indices != range2.contains(element2)) throw AssertionError() + if (element2 !in emptyIntArray.indices != !range2.contains(element2)) throw AssertionError() + if (!(element2 in emptyIntArray.indices) != !range2.contains(element2)) throw AssertionError() + if (!(element2 !in emptyIntArray.indices) != range2.contains(element2)) throw AssertionError() +} + +fun testR2xE3() { + // with possible local optimizations + if ((-1).toLong() in emptyIntArray.indices != range2.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in emptyIntArray.indices != !range2.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in emptyIntArray.indices) != !range2.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in emptyIntArray.indices) != range2.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in emptyIntArray.indices != range2.contains(element3)) throw AssertionError() + if (element3 !in emptyIntArray.indices != !range2.contains(element3)) throw AssertionError() + if (!(element3 in emptyIntArray.indices) != !range2.contains(element3)) throw AssertionError() + if (!(element3 !in emptyIntArray.indices) != range2.contains(element3)) throw AssertionError() +} + +fun testR2xE4() { + // with possible local optimizations + if ((-1).toFloat() in emptyIntArray.indices != range2.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in emptyIntArray.indices != !range2.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in emptyIntArray.indices) != !range2.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in emptyIntArray.indices) != range2.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in emptyIntArray.indices != range2.contains(element4)) throw AssertionError() + if (element4 !in emptyIntArray.indices != !range2.contains(element4)) throw AssertionError() + if (!(element4 in emptyIntArray.indices) != !range2.contains(element4)) throw AssertionError() + if (!(element4 !in emptyIntArray.indices) != range2.contains(element4)) throw AssertionError() +} + +fun testR2xE5() { + // with possible local optimizations + if ((-1).toDouble() in emptyIntArray.indices != range2.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in emptyIntArray.indices != !range2.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in emptyIntArray.indices) != !range2.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in emptyIntArray.indices) != range2.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in emptyIntArray.indices != range2.contains(element5)) throw AssertionError() + if (element5 !in emptyIntArray.indices != !range2.contains(element5)) throw AssertionError() + if (!(element5 in emptyIntArray.indices) != !range2.contains(element5)) throw AssertionError() + if (!(element5 !in emptyIntArray.indices) != range2.contains(element5)) throw AssertionError() +} + +fun testR2xE6() { + // with possible local optimizations + if (0.toByte() in emptyIntArray.indices != range2.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in emptyIntArray.indices != !range2.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in emptyIntArray.indices) != !range2.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in emptyIntArray.indices) != range2.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in emptyIntArray.indices != range2.contains(element6)) throw AssertionError() + if (element6 !in emptyIntArray.indices != !range2.contains(element6)) throw AssertionError() + if (!(element6 in emptyIntArray.indices) != !range2.contains(element6)) throw AssertionError() + if (!(element6 !in emptyIntArray.indices) != range2.contains(element6)) throw AssertionError() +} + +fun testR2xE7() { + // with possible local optimizations + if (0.toShort() in emptyIntArray.indices != range2.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in emptyIntArray.indices != !range2.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in emptyIntArray.indices) != !range2.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in emptyIntArray.indices) != range2.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in emptyIntArray.indices != range2.contains(element7)) throw AssertionError() + if (element7 !in emptyIntArray.indices != !range2.contains(element7)) throw AssertionError() + if (!(element7 in emptyIntArray.indices) != !range2.contains(element7)) throw AssertionError() + if (!(element7 !in emptyIntArray.indices) != range2.contains(element7)) throw AssertionError() +} + +fun testR2xE8() { + // with possible local optimizations + if (0 in emptyIntArray.indices != range2.contains(0)) throw AssertionError() + if (0 !in emptyIntArray.indices != !range2.contains(0)) throw AssertionError() + if (!(0 in emptyIntArray.indices) != !range2.contains(0)) throw AssertionError() + if (!(0 !in emptyIntArray.indices) != range2.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in emptyIntArray.indices != range2.contains(element8)) throw AssertionError() + if (element8 !in emptyIntArray.indices != !range2.contains(element8)) throw AssertionError() + if (!(element8 in emptyIntArray.indices) != !range2.contains(element8)) throw AssertionError() + if (!(element8 !in emptyIntArray.indices) != range2.contains(element8)) throw AssertionError() +} + +fun testR2xE9() { + // with possible local optimizations + if (0.toLong() in emptyIntArray.indices != range2.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in emptyIntArray.indices != !range2.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in emptyIntArray.indices) != !range2.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in emptyIntArray.indices) != range2.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in emptyIntArray.indices != range2.contains(element9)) throw AssertionError() + if (element9 !in emptyIntArray.indices != !range2.contains(element9)) throw AssertionError() + if (!(element9 in emptyIntArray.indices) != !range2.contains(element9)) throw AssertionError() + if (!(element9 !in emptyIntArray.indices) != range2.contains(element9)) throw AssertionError() +} + +fun testR2xE10() { + // with possible local optimizations + if (0.toFloat() in emptyIntArray.indices != range2.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in emptyIntArray.indices != !range2.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in emptyIntArray.indices) != !range2.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in emptyIntArray.indices) != range2.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in emptyIntArray.indices != range2.contains(element10)) throw AssertionError() + if (element10 !in emptyIntArray.indices != !range2.contains(element10)) throw AssertionError() + if (!(element10 in emptyIntArray.indices) != !range2.contains(element10)) throw AssertionError() + if (!(element10 !in emptyIntArray.indices) != range2.contains(element10)) throw AssertionError() +} + +fun testR2xE11() { + // with possible local optimizations + if (0.toDouble() in emptyIntArray.indices != range2.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in emptyIntArray.indices != !range2.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in emptyIntArray.indices) != !range2.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in emptyIntArray.indices) != range2.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in emptyIntArray.indices != range2.contains(element11)) throw AssertionError() + if (element11 !in emptyIntArray.indices != !range2.contains(element11)) throw AssertionError() + if (!(element11 in emptyIntArray.indices) != !range2.contains(element11)) throw AssertionError() + if (!(element11 !in emptyIntArray.indices) != range2.contains(element11)) throw AssertionError() +} + +fun testR2xE12() { + // with possible local optimizations + if (1.toByte() in emptyIntArray.indices != range2.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in emptyIntArray.indices != !range2.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in emptyIntArray.indices) != !range2.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in emptyIntArray.indices) != range2.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in emptyIntArray.indices != range2.contains(element12)) throw AssertionError() + if (element12 !in emptyIntArray.indices != !range2.contains(element12)) throw AssertionError() + if (!(element12 in emptyIntArray.indices) != !range2.contains(element12)) throw AssertionError() + if (!(element12 !in emptyIntArray.indices) != range2.contains(element12)) throw AssertionError() +} + +fun testR2xE13() { + // with possible local optimizations + if (1.toShort() in emptyIntArray.indices != range2.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in emptyIntArray.indices != !range2.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in emptyIntArray.indices) != !range2.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in emptyIntArray.indices) != range2.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in emptyIntArray.indices != range2.contains(element13)) throw AssertionError() + if (element13 !in emptyIntArray.indices != !range2.contains(element13)) throw AssertionError() + if (!(element13 in emptyIntArray.indices) != !range2.contains(element13)) throw AssertionError() + if (!(element13 !in emptyIntArray.indices) != range2.contains(element13)) throw AssertionError() +} + +fun testR2xE14() { + // with possible local optimizations + if (1 in emptyIntArray.indices != range2.contains(1)) throw AssertionError() + if (1 !in emptyIntArray.indices != !range2.contains(1)) throw AssertionError() + if (!(1 in emptyIntArray.indices) != !range2.contains(1)) throw AssertionError() + if (!(1 !in emptyIntArray.indices) != range2.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in emptyIntArray.indices != range2.contains(element14)) throw AssertionError() + if (element14 !in emptyIntArray.indices != !range2.contains(element14)) throw AssertionError() + if (!(element14 in emptyIntArray.indices) != !range2.contains(element14)) throw AssertionError() + if (!(element14 !in emptyIntArray.indices) != range2.contains(element14)) throw AssertionError() +} + +fun testR2xE15() { + // with possible local optimizations + if (1.toLong() in emptyIntArray.indices != range2.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in emptyIntArray.indices != !range2.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in emptyIntArray.indices) != !range2.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in emptyIntArray.indices) != range2.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in emptyIntArray.indices != range2.contains(element15)) throw AssertionError() + if (element15 !in emptyIntArray.indices != !range2.contains(element15)) throw AssertionError() + if (!(element15 in emptyIntArray.indices) != !range2.contains(element15)) throw AssertionError() + if (!(element15 !in emptyIntArray.indices) != range2.contains(element15)) throw AssertionError() +} + +fun testR2xE16() { + // with possible local optimizations + if (1.toFloat() in emptyIntArray.indices != range2.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in emptyIntArray.indices != !range2.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in emptyIntArray.indices) != !range2.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in emptyIntArray.indices) != range2.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in emptyIntArray.indices != range2.contains(element16)) throw AssertionError() + if (element16 !in emptyIntArray.indices != !range2.contains(element16)) throw AssertionError() + if (!(element16 in emptyIntArray.indices) != !range2.contains(element16)) throw AssertionError() + if (!(element16 !in emptyIntArray.indices) != range2.contains(element16)) throw AssertionError() +} + +fun testR2xE17() { + // with possible local optimizations + if (1.toDouble() in emptyIntArray.indices != range2.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in emptyIntArray.indices != !range2.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in emptyIntArray.indices) != !range2.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in emptyIntArray.indices) != range2.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in emptyIntArray.indices != range2.contains(element17)) throw AssertionError() + if (element17 !in emptyIntArray.indices != !range2.contains(element17)) throw AssertionError() + if (!(element17 in emptyIntArray.indices) != !range2.contains(element17)) throw AssertionError() + if (!(element17 !in emptyIntArray.indices) != range2.contains(element17)) throw AssertionError() +} + +fun testR2xE18() { + // with possible local optimizations + if (2.toByte() in emptyIntArray.indices != range2.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in emptyIntArray.indices != !range2.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in emptyIntArray.indices) != !range2.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in emptyIntArray.indices) != range2.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in emptyIntArray.indices != range2.contains(element18)) throw AssertionError() + if (element18 !in emptyIntArray.indices != !range2.contains(element18)) throw AssertionError() + if (!(element18 in emptyIntArray.indices) != !range2.contains(element18)) throw AssertionError() + if (!(element18 !in emptyIntArray.indices) != range2.contains(element18)) throw AssertionError() +} + +fun testR2xE19() { + // with possible local optimizations + if (2.toShort() in emptyIntArray.indices != range2.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in emptyIntArray.indices != !range2.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in emptyIntArray.indices) != !range2.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in emptyIntArray.indices) != range2.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in emptyIntArray.indices != range2.contains(element19)) throw AssertionError() + if (element19 !in emptyIntArray.indices != !range2.contains(element19)) throw AssertionError() + if (!(element19 in emptyIntArray.indices) != !range2.contains(element19)) throw AssertionError() + if (!(element19 !in emptyIntArray.indices) != range2.contains(element19)) throw AssertionError() +} + +fun testR2xE20() { + // with possible local optimizations + if (2 in emptyIntArray.indices != range2.contains(2)) throw AssertionError() + if (2 !in emptyIntArray.indices != !range2.contains(2)) throw AssertionError() + if (!(2 in emptyIntArray.indices) != !range2.contains(2)) throw AssertionError() + if (!(2 !in emptyIntArray.indices) != range2.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in emptyIntArray.indices != range2.contains(element20)) throw AssertionError() + if (element20 !in emptyIntArray.indices != !range2.contains(element20)) throw AssertionError() + if (!(element20 in emptyIntArray.indices) != !range2.contains(element20)) throw AssertionError() + if (!(element20 !in emptyIntArray.indices) != range2.contains(element20)) throw AssertionError() +} + +fun testR2xE21() { + // with possible local optimizations + if (2.toLong() in emptyIntArray.indices != range2.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in emptyIntArray.indices != !range2.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in emptyIntArray.indices) != !range2.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in emptyIntArray.indices) != range2.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in emptyIntArray.indices != range2.contains(element21)) throw AssertionError() + if (element21 !in emptyIntArray.indices != !range2.contains(element21)) throw AssertionError() + if (!(element21 in emptyIntArray.indices) != !range2.contains(element21)) throw AssertionError() + if (!(element21 !in emptyIntArray.indices) != range2.contains(element21)) throw AssertionError() +} + +fun testR2xE22() { + // with possible local optimizations + if (2.toFloat() in emptyIntArray.indices != range2.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in emptyIntArray.indices != !range2.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in emptyIntArray.indices) != !range2.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in emptyIntArray.indices) != range2.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in emptyIntArray.indices != range2.contains(element22)) throw AssertionError() + if (element22 !in emptyIntArray.indices != !range2.contains(element22)) throw AssertionError() + if (!(element22 in emptyIntArray.indices) != !range2.contains(element22)) throw AssertionError() + if (!(element22 !in emptyIntArray.indices) != range2.contains(element22)) throw AssertionError() +} + +fun testR2xE23() { + // with possible local optimizations + if (2.toDouble() in emptyIntArray.indices != range2.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in emptyIntArray.indices != !range2.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in emptyIntArray.indices) != !range2.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in emptyIntArray.indices) != range2.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in emptyIntArray.indices != range2.contains(element23)) throw AssertionError() + if (element23 !in emptyIntArray.indices != !range2.contains(element23)) throw AssertionError() + if (!(element23 in emptyIntArray.indices) != !range2.contains(element23)) throw AssertionError() + if (!(element23 !in emptyIntArray.indices) != range2.contains(element23)) throw AssertionError() +} + +fun testR2xE24() { + // with possible local optimizations + if (3.toByte() in emptyIntArray.indices != range2.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in emptyIntArray.indices != !range2.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in emptyIntArray.indices) != !range2.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in emptyIntArray.indices) != range2.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in emptyIntArray.indices != range2.contains(element24)) throw AssertionError() + if (element24 !in emptyIntArray.indices != !range2.contains(element24)) throw AssertionError() + if (!(element24 in emptyIntArray.indices) != !range2.contains(element24)) throw AssertionError() + if (!(element24 !in emptyIntArray.indices) != range2.contains(element24)) throw AssertionError() +} + +fun testR2xE25() { + // with possible local optimizations + if (3.toShort() in emptyIntArray.indices != range2.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in emptyIntArray.indices != !range2.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in emptyIntArray.indices) != !range2.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in emptyIntArray.indices) != range2.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in emptyIntArray.indices != range2.contains(element25)) throw AssertionError() + if (element25 !in emptyIntArray.indices != !range2.contains(element25)) throw AssertionError() + if (!(element25 in emptyIntArray.indices) != !range2.contains(element25)) throw AssertionError() + if (!(element25 !in emptyIntArray.indices) != range2.contains(element25)) throw AssertionError() +} + +fun testR2xE26() { + // with possible local optimizations + if (3 in emptyIntArray.indices != range2.contains(3)) throw AssertionError() + if (3 !in emptyIntArray.indices != !range2.contains(3)) throw AssertionError() + if (!(3 in emptyIntArray.indices) != !range2.contains(3)) throw AssertionError() + if (!(3 !in emptyIntArray.indices) != range2.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in emptyIntArray.indices != range2.contains(element26)) throw AssertionError() + if (element26 !in emptyIntArray.indices != !range2.contains(element26)) throw AssertionError() + if (!(element26 in emptyIntArray.indices) != !range2.contains(element26)) throw AssertionError() + if (!(element26 !in emptyIntArray.indices) != range2.contains(element26)) throw AssertionError() +} + +fun testR2xE27() { + // with possible local optimizations + if (3.toLong() in emptyIntArray.indices != range2.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in emptyIntArray.indices != !range2.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in emptyIntArray.indices) != !range2.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in emptyIntArray.indices) != range2.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in emptyIntArray.indices != range2.contains(element27)) throw AssertionError() + if (element27 !in emptyIntArray.indices != !range2.contains(element27)) throw AssertionError() + if (!(element27 in emptyIntArray.indices) != !range2.contains(element27)) throw AssertionError() + if (!(element27 !in emptyIntArray.indices) != range2.contains(element27)) throw AssertionError() +} + +fun testR2xE28() { + // with possible local optimizations + if (3.toFloat() in emptyIntArray.indices != range2.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in emptyIntArray.indices != !range2.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in emptyIntArray.indices) != !range2.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in emptyIntArray.indices) != range2.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in emptyIntArray.indices != range2.contains(element28)) throw AssertionError() + if (element28 !in emptyIntArray.indices != !range2.contains(element28)) throw AssertionError() + if (!(element28 in emptyIntArray.indices) != !range2.contains(element28)) throw AssertionError() + if (!(element28 !in emptyIntArray.indices) != range2.contains(element28)) throw AssertionError() +} + +fun testR2xE29() { + // with possible local optimizations + if (3.toDouble() in emptyIntArray.indices != range2.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in emptyIntArray.indices != !range2.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in emptyIntArray.indices) != !range2.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in emptyIntArray.indices) != range2.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in emptyIntArray.indices != range2.contains(element29)) throw AssertionError() + if (element29 !in emptyIntArray.indices != !range2.contains(element29)) throw AssertionError() + if (!(element29 in emptyIntArray.indices) != !range2.contains(element29)) throw AssertionError() + if (!(element29 !in emptyIntArray.indices) != range2.contains(element29)) throw AssertionError() +} + +fun testR2xE30() { + // with possible local optimizations + if (4.toByte() in emptyIntArray.indices != range2.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in emptyIntArray.indices != !range2.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in emptyIntArray.indices) != !range2.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in emptyIntArray.indices) != range2.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in emptyIntArray.indices != range2.contains(element30)) throw AssertionError() + if (element30 !in emptyIntArray.indices != !range2.contains(element30)) throw AssertionError() + if (!(element30 in emptyIntArray.indices) != !range2.contains(element30)) throw AssertionError() + if (!(element30 !in emptyIntArray.indices) != range2.contains(element30)) throw AssertionError() +} + +fun testR2xE31() { + // with possible local optimizations + if (4.toShort() in emptyIntArray.indices != range2.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in emptyIntArray.indices != !range2.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in emptyIntArray.indices) != !range2.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in emptyIntArray.indices) != range2.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in emptyIntArray.indices != range2.contains(element31)) throw AssertionError() + if (element31 !in emptyIntArray.indices != !range2.contains(element31)) throw AssertionError() + if (!(element31 in emptyIntArray.indices) != !range2.contains(element31)) throw AssertionError() + if (!(element31 !in emptyIntArray.indices) != range2.contains(element31)) throw AssertionError() +} + +fun testR2xE32() { + // with possible local optimizations + if (4 in emptyIntArray.indices != range2.contains(4)) throw AssertionError() + if (4 !in emptyIntArray.indices != !range2.contains(4)) throw AssertionError() + if (!(4 in emptyIntArray.indices) != !range2.contains(4)) throw AssertionError() + if (!(4 !in emptyIntArray.indices) != range2.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in emptyIntArray.indices != range2.contains(element32)) throw AssertionError() + if (element32 !in emptyIntArray.indices != !range2.contains(element32)) throw AssertionError() + if (!(element32 in emptyIntArray.indices) != !range2.contains(element32)) throw AssertionError() + if (!(element32 !in emptyIntArray.indices) != range2.contains(element32)) throw AssertionError() +} + +fun testR2xE33() { + // with possible local optimizations + if (4.toLong() in emptyIntArray.indices != range2.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in emptyIntArray.indices != !range2.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in emptyIntArray.indices) != !range2.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in emptyIntArray.indices) != range2.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in emptyIntArray.indices != range2.contains(element33)) throw AssertionError() + if (element33 !in emptyIntArray.indices != !range2.contains(element33)) throw AssertionError() + if (!(element33 in emptyIntArray.indices) != !range2.contains(element33)) throw AssertionError() + if (!(element33 !in emptyIntArray.indices) != range2.contains(element33)) throw AssertionError() +} + +fun testR2xE34() { + // with possible local optimizations + if (4.toFloat() in emptyIntArray.indices != range2.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in emptyIntArray.indices != !range2.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in emptyIntArray.indices) != !range2.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in emptyIntArray.indices) != range2.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in emptyIntArray.indices != range2.contains(element34)) throw AssertionError() + if (element34 !in emptyIntArray.indices != !range2.contains(element34)) throw AssertionError() + if (!(element34 in emptyIntArray.indices) != !range2.contains(element34)) throw AssertionError() + if (!(element34 !in emptyIntArray.indices) != range2.contains(element34)) throw AssertionError() +} + +fun testR2xE35() { + // with possible local optimizations + if (4.toDouble() in emptyIntArray.indices != range2.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in emptyIntArray.indices != !range2.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in emptyIntArray.indices) != !range2.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in emptyIntArray.indices) != range2.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in emptyIntArray.indices != range2.contains(element35)) throw AssertionError() + if (element35 !in emptyIntArray.indices != !range2.contains(element35)) throw AssertionError() + if (!(element35 in emptyIntArray.indices) != !range2.contains(element35)) throw AssertionError() + if (!(element35 !in emptyIntArray.indices) != range2.contains(element35)) throw AssertionError() +} + +fun testR3xE0() { + // with possible local optimizations + if ((-1).toByte() in emptyObjectArray.indices != range3.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in emptyObjectArray.indices != !range3.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in emptyObjectArray.indices) != !range3.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in emptyObjectArray.indices) != range3.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in emptyObjectArray.indices != range3.contains(element0)) throw AssertionError() + if (element0 !in emptyObjectArray.indices != !range3.contains(element0)) throw AssertionError() + if (!(element0 in emptyObjectArray.indices) != !range3.contains(element0)) throw AssertionError() + if (!(element0 !in emptyObjectArray.indices) != range3.contains(element0)) throw AssertionError() +} + +fun testR3xE1() { + // with possible local optimizations + if ((-1).toShort() in emptyObjectArray.indices != range3.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in emptyObjectArray.indices != !range3.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in emptyObjectArray.indices) != !range3.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in emptyObjectArray.indices) != range3.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in emptyObjectArray.indices != range3.contains(element1)) throw AssertionError() + if (element1 !in emptyObjectArray.indices != !range3.contains(element1)) throw AssertionError() + if (!(element1 in emptyObjectArray.indices) != !range3.contains(element1)) throw AssertionError() + if (!(element1 !in emptyObjectArray.indices) != range3.contains(element1)) throw AssertionError() +} + +fun testR3xE2() { + // with possible local optimizations + if ((-1) in emptyObjectArray.indices != range3.contains((-1))) throw AssertionError() + if ((-1) !in emptyObjectArray.indices != !range3.contains((-1))) throw AssertionError() + if (!((-1) in emptyObjectArray.indices) != !range3.contains((-1))) throw AssertionError() + if (!((-1) !in emptyObjectArray.indices) != range3.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in emptyObjectArray.indices != range3.contains(element2)) throw AssertionError() + if (element2 !in emptyObjectArray.indices != !range3.contains(element2)) throw AssertionError() + if (!(element2 in emptyObjectArray.indices) != !range3.contains(element2)) throw AssertionError() + if (!(element2 !in emptyObjectArray.indices) != range3.contains(element2)) throw AssertionError() +} + +fun testR3xE3() { + // with possible local optimizations + if ((-1).toLong() in emptyObjectArray.indices != range3.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in emptyObjectArray.indices != !range3.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in emptyObjectArray.indices) != !range3.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in emptyObjectArray.indices) != range3.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in emptyObjectArray.indices != range3.contains(element3)) throw AssertionError() + if (element3 !in emptyObjectArray.indices != !range3.contains(element3)) throw AssertionError() + if (!(element3 in emptyObjectArray.indices) != !range3.contains(element3)) throw AssertionError() + if (!(element3 !in emptyObjectArray.indices) != range3.contains(element3)) throw AssertionError() +} + +fun testR3xE4() { + // with possible local optimizations + if ((-1).toFloat() in emptyObjectArray.indices != range3.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in emptyObjectArray.indices != !range3.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in emptyObjectArray.indices) != !range3.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in emptyObjectArray.indices) != range3.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in emptyObjectArray.indices != range3.contains(element4)) throw AssertionError() + if (element4 !in emptyObjectArray.indices != !range3.contains(element4)) throw AssertionError() + if (!(element4 in emptyObjectArray.indices) != !range3.contains(element4)) throw AssertionError() + if (!(element4 !in emptyObjectArray.indices) != range3.contains(element4)) throw AssertionError() +} + +fun testR3xE5() { + // with possible local optimizations + if ((-1).toDouble() in emptyObjectArray.indices != range3.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in emptyObjectArray.indices != !range3.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in emptyObjectArray.indices) != !range3.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in emptyObjectArray.indices) != range3.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in emptyObjectArray.indices != range3.contains(element5)) throw AssertionError() + if (element5 !in emptyObjectArray.indices != !range3.contains(element5)) throw AssertionError() + if (!(element5 in emptyObjectArray.indices) != !range3.contains(element5)) throw AssertionError() + if (!(element5 !in emptyObjectArray.indices) != range3.contains(element5)) throw AssertionError() +} + +fun testR3xE6() { + // with possible local optimizations + if (0.toByte() in emptyObjectArray.indices != range3.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in emptyObjectArray.indices != !range3.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in emptyObjectArray.indices) != !range3.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in emptyObjectArray.indices) != range3.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in emptyObjectArray.indices != range3.contains(element6)) throw AssertionError() + if (element6 !in emptyObjectArray.indices != !range3.contains(element6)) throw AssertionError() + if (!(element6 in emptyObjectArray.indices) != !range3.contains(element6)) throw AssertionError() + if (!(element6 !in emptyObjectArray.indices) != range3.contains(element6)) throw AssertionError() +} + +fun testR3xE7() { + // with possible local optimizations + if (0.toShort() in emptyObjectArray.indices != range3.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in emptyObjectArray.indices != !range3.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in emptyObjectArray.indices) != !range3.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in emptyObjectArray.indices) != range3.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in emptyObjectArray.indices != range3.contains(element7)) throw AssertionError() + if (element7 !in emptyObjectArray.indices != !range3.contains(element7)) throw AssertionError() + if (!(element7 in emptyObjectArray.indices) != !range3.contains(element7)) throw AssertionError() + if (!(element7 !in emptyObjectArray.indices) != range3.contains(element7)) throw AssertionError() +} + +fun testR3xE8() { + // with possible local optimizations + if (0 in emptyObjectArray.indices != range3.contains(0)) throw AssertionError() + if (0 !in emptyObjectArray.indices != !range3.contains(0)) throw AssertionError() + if (!(0 in emptyObjectArray.indices) != !range3.contains(0)) throw AssertionError() + if (!(0 !in emptyObjectArray.indices) != range3.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in emptyObjectArray.indices != range3.contains(element8)) throw AssertionError() + if (element8 !in emptyObjectArray.indices != !range3.contains(element8)) throw AssertionError() + if (!(element8 in emptyObjectArray.indices) != !range3.contains(element8)) throw AssertionError() + if (!(element8 !in emptyObjectArray.indices) != range3.contains(element8)) throw AssertionError() +} + +fun testR3xE9() { + // with possible local optimizations + if (0.toLong() in emptyObjectArray.indices != range3.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in emptyObjectArray.indices != !range3.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in emptyObjectArray.indices) != !range3.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in emptyObjectArray.indices) != range3.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in emptyObjectArray.indices != range3.contains(element9)) throw AssertionError() + if (element9 !in emptyObjectArray.indices != !range3.contains(element9)) throw AssertionError() + if (!(element9 in emptyObjectArray.indices) != !range3.contains(element9)) throw AssertionError() + if (!(element9 !in emptyObjectArray.indices) != range3.contains(element9)) throw AssertionError() +} + +fun testR3xE10() { + // with possible local optimizations + if (0.toFloat() in emptyObjectArray.indices != range3.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in emptyObjectArray.indices != !range3.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in emptyObjectArray.indices) != !range3.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in emptyObjectArray.indices) != range3.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in emptyObjectArray.indices != range3.contains(element10)) throw AssertionError() + if (element10 !in emptyObjectArray.indices != !range3.contains(element10)) throw AssertionError() + if (!(element10 in emptyObjectArray.indices) != !range3.contains(element10)) throw AssertionError() + if (!(element10 !in emptyObjectArray.indices) != range3.contains(element10)) throw AssertionError() +} + +fun testR3xE11() { + // with possible local optimizations + if (0.toDouble() in emptyObjectArray.indices != range3.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in emptyObjectArray.indices != !range3.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in emptyObjectArray.indices) != !range3.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in emptyObjectArray.indices) != range3.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in emptyObjectArray.indices != range3.contains(element11)) throw AssertionError() + if (element11 !in emptyObjectArray.indices != !range3.contains(element11)) throw AssertionError() + if (!(element11 in emptyObjectArray.indices) != !range3.contains(element11)) throw AssertionError() + if (!(element11 !in emptyObjectArray.indices) != range3.contains(element11)) throw AssertionError() +} + +fun testR3xE12() { + // with possible local optimizations + if (1.toByte() in emptyObjectArray.indices != range3.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in emptyObjectArray.indices != !range3.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in emptyObjectArray.indices) != !range3.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in emptyObjectArray.indices) != range3.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in emptyObjectArray.indices != range3.contains(element12)) throw AssertionError() + if (element12 !in emptyObjectArray.indices != !range3.contains(element12)) throw AssertionError() + if (!(element12 in emptyObjectArray.indices) != !range3.contains(element12)) throw AssertionError() + if (!(element12 !in emptyObjectArray.indices) != range3.contains(element12)) throw AssertionError() +} + +fun testR3xE13() { + // with possible local optimizations + if (1.toShort() in emptyObjectArray.indices != range3.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in emptyObjectArray.indices != !range3.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in emptyObjectArray.indices) != !range3.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in emptyObjectArray.indices) != range3.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in emptyObjectArray.indices != range3.contains(element13)) throw AssertionError() + if (element13 !in emptyObjectArray.indices != !range3.contains(element13)) throw AssertionError() + if (!(element13 in emptyObjectArray.indices) != !range3.contains(element13)) throw AssertionError() + if (!(element13 !in emptyObjectArray.indices) != range3.contains(element13)) throw AssertionError() +} + +fun testR3xE14() { + // with possible local optimizations + if (1 in emptyObjectArray.indices != range3.contains(1)) throw AssertionError() + if (1 !in emptyObjectArray.indices != !range3.contains(1)) throw AssertionError() + if (!(1 in emptyObjectArray.indices) != !range3.contains(1)) throw AssertionError() + if (!(1 !in emptyObjectArray.indices) != range3.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in emptyObjectArray.indices != range3.contains(element14)) throw AssertionError() + if (element14 !in emptyObjectArray.indices != !range3.contains(element14)) throw AssertionError() + if (!(element14 in emptyObjectArray.indices) != !range3.contains(element14)) throw AssertionError() + if (!(element14 !in emptyObjectArray.indices) != range3.contains(element14)) throw AssertionError() +} + +fun testR3xE15() { + // with possible local optimizations + if (1.toLong() in emptyObjectArray.indices != range3.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in emptyObjectArray.indices != !range3.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in emptyObjectArray.indices) != !range3.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in emptyObjectArray.indices) != range3.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in emptyObjectArray.indices != range3.contains(element15)) throw AssertionError() + if (element15 !in emptyObjectArray.indices != !range3.contains(element15)) throw AssertionError() + if (!(element15 in emptyObjectArray.indices) != !range3.contains(element15)) throw AssertionError() + if (!(element15 !in emptyObjectArray.indices) != range3.contains(element15)) throw AssertionError() +} + +fun testR3xE16() { + // with possible local optimizations + if (1.toFloat() in emptyObjectArray.indices != range3.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in emptyObjectArray.indices != !range3.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in emptyObjectArray.indices) != !range3.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in emptyObjectArray.indices) != range3.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in emptyObjectArray.indices != range3.contains(element16)) throw AssertionError() + if (element16 !in emptyObjectArray.indices != !range3.contains(element16)) throw AssertionError() + if (!(element16 in emptyObjectArray.indices) != !range3.contains(element16)) throw AssertionError() + if (!(element16 !in emptyObjectArray.indices) != range3.contains(element16)) throw AssertionError() +} + +fun testR3xE17() { + // with possible local optimizations + if (1.toDouble() in emptyObjectArray.indices != range3.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in emptyObjectArray.indices != !range3.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in emptyObjectArray.indices) != !range3.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in emptyObjectArray.indices) != range3.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in emptyObjectArray.indices != range3.contains(element17)) throw AssertionError() + if (element17 !in emptyObjectArray.indices != !range3.contains(element17)) throw AssertionError() + if (!(element17 in emptyObjectArray.indices) != !range3.contains(element17)) throw AssertionError() + if (!(element17 !in emptyObjectArray.indices) != range3.contains(element17)) throw AssertionError() +} + +fun testR3xE18() { + // with possible local optimizations + if (2.toByte() in emptyObjectArray.indices != range3.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in emptyObjectArray.indices != !range3.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in emptyObjectArray.indices) != !range3.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in emptyObjectArray.indices) != range3.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in emptyObjectArray.indices != range3.contains(element18)) throw AssertionError() + if (element18 !in emptyObjectArray.indices != !range3.contains(element18)) throw AssertionError() + if (!(element18 in emptyObjectArray.indices) != !range3.contains(element18)) throw AssertionError() + if (!(element18 !in emptyObjectArray.indices) != range3.contains(element18)) throw AssertionError() +} + +fun testR3xE19() { + // with possible local optimizations + if (2.toShort() in emptyObjectArray.indices != range3.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in emptyObjectArray.indices != !range3.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in emptyObjectArray.indices) != !range3.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in emptyObjectArray.indices) != range3.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in emptyObjectArray.indices != range3.contains(element19)) throw AssertionError() + if (element19 !in emptyObjectArray.indices != !range3.contains(element19)) throw AssertionError() + if (!(element19 in emptyObjectArray.indices) != !range3.contains(element19)) throw AssertionError() + if (!(element19 !in emptyObjectArray.indices) != range3.contains(element19)) throw AssertionError() +} + +fun testR3xE20() { + // with possible local optimizations + if (2 in emptyObjectArray.indices != range3.contains(2)) throw AssertionError() + if (2 !in emptyObjectArray.indices != !range3.contains(2)) throw AssertionError() + if (!(2 in emptyObjectArray.indices) != !range3.contains(2)) throw AssertionError() + if (!(2 !in emptyObjectArray.indices) != range3.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in emptyObjectArray.indices != range3.contains(element20)) throw AssertionError() + if (element20 !in emptyObjectArray.indices != !range3.contains(element20)) throw AssertionError() + if (!(element20 in emptyObjectArray.indices) != !range3.contains(element20)) throw AssertionError() + if (!(element20 !in emptyObjectArray.indices) != range3.contains(element20)) throw AssertionError() +} + +fun testR3xE21() { + // with possible local optimizations + if (2.toLong() in emptyObjectArray.indices != range3.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in emptyObjectArray.indices != !range3.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in emptyObjectArray.indices) != !range3.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in emptyObjectArray.indices) != range3.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in emptyObjectArray.indices != range3.contains(element21)) throw AssertionError() + if (element21 !in emptyObjectArray.indices != !range3.contains(element21)) throw AssertionError() + if (!(element21 in emptyObjectArray.indices) != !range3.contains(element21)) throw AssertionError() + if (!(element21 !in emptyObjectArray.indices) != range3.contains(element21)) throw AssertionError() +} + +fun testR3xE22() { + // with possible local optimizations + if (2.toFloat() in emptyObjectArray.indices != range3.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in emptyObjectArray.indices != !range3.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in emptyObjectArray.indices) != !range3.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in emptyObjectArray.indices) != range3.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in emptyObjectArray.indices != range3.contains(element22)) throw AssertionError() + if (element22 !in emptyObjectArray.indices != !range3.contains(element22)) throw AssertionError() + if (!(element22 in emptyObjectArray.indices) != !range3.contains(element22)) throw AssertionError() + if (!(element22 !in emptyObjectArray.indices) != range3.contains(element22)) throw AssertionError() +} + +fun testR3xE23() { + // with possible local optimizations + if (2.toDouble() in emptyObjectArray.indices != range3.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in emptyObjectArray.indices != !range3.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in emptyObjectArray.indices) != !range3.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in emptyObjectArray.indices) != range3.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in emptyObjectArray.indices != range3.contains(element23)) throw AssertionError() + if (element23 !in emptyObjectArray.indices != !range3.contains(element23)) throw AssertionError() + if (!(element23 in emptyObjectArray.indices) != !range3.contains(element23)) throw AssertionError() + if (!(element23 !in emptyObjectArray.indices) != range3.contains(element23)) throw AssertionError() +} + +fun testR3xE24() { + // with possible local optimizations + if (3.toByte() in emptyObjectArray.indices != range3.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in emptyObjectArray.indices != !range3.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in emptyObjectArray.indices) != !range3.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in emptyObjectArray.indices) != range3.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in emptyObjectArray.indices != range3.contains(element24)) throw AssertionError() + if (element24 !in emptyObjectArray.indices != !range3.contains(element24)) throw AssertionError() + if (!(element24 in emptyObjectArray.indices) != !range3.contains(element24)) throw AssertionError() + if (!(element24 !in emptyObjectArray.indices) != range3.contains(element24)) throw AssertionError() +} + +fun testR3xE25() { + // with possible local optimizations + if (3.toShort() in emptyObjectArray.indices != range3.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in emptyObjectArray.indices != !range3.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in emptyObjectArray.indices) != !range3.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in emptyObjectArray.indices) != range3.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in emptyObjectArray.indices != range3.contains(element25)) throw AssertionError() + if (element25 !in emptyObjectArray.indices != !range3.contains(element25)) throw AssertionError() + if (!(element25 in emptyObjectArray.indices) != !range3.contains(element25)) throw AssertionError() + if (!(element25 !in emptyObjectArray.indices) != range3.contains(element25)) throw AssertionError() +} + +fun testR3xE26() { + // with possible local optimizations + if (3 in emptyObjectArray.indices != range3.contains(3)) throw AssertionError() + if (3 !in emptyObjectArray.indices != !range3.contains(3)) throw AssertionError() + if (!(3 in emptyObjectArray.indices) != !range3.contains(3)) throw AssertionError() + if (!(3 !in emptyObjectArray.indices) != range3.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in emptyObjectArray.indices != range3.contains(element26)) throw AssertionError() + if (element26 !in emptyObjectArray.indices != !range3.contains(element26)) throw AssertionError() + if (!(element26 in emptyObjectArray.indices) != !range3.contains(element26)) throw AssertionError() + if (!(element26 !in emptyObjectArray.indices) != range3.contains(element26)) throw AssertionError() +} + +fun testR3xE27() { + // with possible local optimizations + if (3.toLong() in emptyObjectArray.indices != range3.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in emptyObjectArray.indices != !range3.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in emptyObjectArray.indices) != !range3.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in emptyObjectArray.indices) != range3.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in emptyObjectArray.indices != range3.contains(element27)) throw AssertionError() + if (element27 !in emptyObjectArray.indices != !range3.contains(element27)) throw AssertionError() + if (!(element27 in emptyObjectArray.indices) != !range3.contains(element27)) throw AssertionError() + if (!(element27 !in emptyObjectArray.indices) != range3.contains(element27)) throw AssertionError() +} + +fun testR3xE28() { + // with possible local optimizations + if (3.toFloat() in emptyObjectArray.indices != range3.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in emptyObjectArray.indices != !range3.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in emptyObjectArray.indices) != !range3.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in emptyObjectArray.indices) != range3.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in emptyObjectArray.indices != range3.contains(element28)) throw AssertionError() + if (element28 !in emptyObjectArray.indices != !range3.contains(element28)) throw AssertionError() + if (!(element28 in emptyObjectArray.indices) != !range3.contains(element28)) throw AssertionError() + if (!(element28 !in emptyObjectArray.indices) != range3.contains(element28)) throw AssertionError() +} + +fun testR3xE29() { + // with possible local optimizations + if (3.toDouble() in emptyObjectArray.indices != range3.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in emptyObjectArray.indices != !range3.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in emptyObjectArray.indices) != !range3.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in emptyObjectArray.indices) != range3.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in emptyObjectArray.indices != range3.contains(element29)) throw AssertionError() + if (element29 !in emptyObjectArray.indices != !range3.contains(element29)) throw AssertionError() + if (!(element29 in emptyObjectArray.indices) != !range3.contains(element29)) throw AssertionError() + if (!(element29 !in emptyObjectArray.indices) != range3.contains(element29)) throw AssertionError() +} + +fun testR3xE30() { + // with possible local optimizations + if (4.toByte() in emptyObjectArray.indices != range3.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in emptyObjectArray.indices != !range3.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in emptyObjectArray.indices) != !range3.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in emptyObjectArray.indices) != range3.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in emptyObjectArray.indices != range3.contains(element30)) throw AssertionError() + if (element30 !in emptyObjectArray.indices != !range3.contains(element30)) throw AssertionError() + if (!(element30 in emptyObjectArray.indices) != !range3.contains(element30)) throw AssertionError() + if (!(element30 !in emptyObjectArray.indices) != range3.contains(element30)) throw AssertionError() +} + +fun testR3xE31() { + // with possible local optimizations + if (4.toShort() in emptyObjectArray.indices != range3.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in emptyObjectArray.indices != !range3.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in emptyObjectArray.indices) != !range3.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in emptyObjectArray.indices) != range3.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in emptyObjectArray.indices != range3.contains(element31)) throw AssertionError() + if (element31 !in emptyObjectArray.indices != !range3.contains(element31)) throw AssertionError() + if (!(element31 in emptyObjectArray.indices) != !range3.contains(element31)) throw AssertionError() + if (!(element31 !in emptyObjectArray.indices) != range3.contains(element31)) throw AssertionError() +} + +fun testR3xE32() { + // with possible local optimizations + if (4 in emptyObjectArray.indices != range3.contains(4)) throw AssertionError() + if (4 !in emptyObjectArray.indices != !range3.contains(4)) throw AssertionError() + if (!(4 in emptyObjectArray.indices) != !range3.contains(4)) throw AssertionError() + if (!(4 !in emptyObjectArray.indices) != range3.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in emptyObjectArray.indices != range3.contains(element32)) throw AssertionError() + if (element32 !in emptyObjectArray.indices != !range3.contains(element32)) throw AssertionError() + if (!(element32 in emptyObjectArray.indices) != !range3.contains(element32)) throw AssertionError() + if (!(element32 !in emptyObjectArray.indices) != range3.contains(element32)) throw AssertionError() +} + +fun testR3xE33() { + // with possible local optimizations + if (4.toLong() in emptyObjectArray.indices != range3.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in emptyObjectArray.indices != !range3.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in emptyObjectArray.indices) != !range3.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in emptyObjectArray.indices) != range3.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in emptyObjectArray.indices != range3.contains(element33)) throw AssertionError() + if (element33 !in emptyObjectArray.indices != !range3.contains(element33)) throw AssertionError() + if (!(element33 in emptyObjectArray.indices) != !range3.contains(element33)) throw AssertionError() + if (!(element33 !in emptyObjectArray.indices) != range3.contains(element33)) throw AssertionError() +} + +fun testR3xE34() { + // with possible local optimizations + if (4.toFloat() in emptyObjectArray.indices != range3.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in emptyObjectArray.indices != !range3.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in emptyObjectArray.indices) != !range3.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in emptyObjectArray.indices) != range3.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in emptyObjectArray.indices != range3.contains(element34)) throw AssertionError() + if (element34 !in emptyObjectArray.indices != !range3.contains(element34)) throw AssertionError() + if (!(element34 in emptyObjectArray.indices) != !range3.contains(element34)) throw AssertionError() + if (!(element34 !in emptyObjectArray.indices) != range3.contains(element34)) throw AssertionError() +} + +fun testR3xE35() { + // with possible local optimizations + if (4.toDouble() in emptyObjectArray.indices != range3.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in emptyObjectArray.indices != !range3.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in emptyObjectArray.indices) != !range3.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in emptyObjectArray.indices) != range3.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in emptyObjectArray.indices != range3.contains(element35)) throw AssertionError() + if (element35 !in emptyObjectArray.indices != !range3.contains(element35)) throw AssertionError() + if (!(element35 in emptyObjectArray.indices) != !range3.contains(element35)) throw AssertionError() + if (!(element35 !in emptyObjectArray.indices) != range3.contains(element35)) throw AssertionError() +} + + diff --git a/backend.native/tests/external/codegen/box/ranges/contains/generated/charDownTo.kt b/backend.native/tests/external/codegen/box/ranges/contains/generated/charDownTo.kt new file mode 100644 index 00000000000..a2256df17ba --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/generated/charDownTo.kt @@ -0,0 +1,159 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_RUNTIME + + + +val range0 = '3' downTo '1' +val range1 = '1' downTo '3' + +val element0 = '0' +val element1 = '1' +val element2 = '2' +val element3 = '3' +val element4 = '4' + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if ('0' in '3' downTo '1' != range0.contains('0')) throw AssertionError() + if ('0' !in '3' downTo '1' != !range0.contains('0')) throw AssertionError() + if (!('0' in '3' downTo '1') != !range0.contains('0')) throw AssertionError() + if (!('0' !in '3' downTo '1') != range0.contains('0')) throw AssertionError() + // no local optimizations + if (element0 in '3' downTo '1' != range0.contains(element0)) throw AssertionError() + if (element0 !in '3' downTo '1' != !range0.contains(element0)) throw AssertionError() + if (!(element0 in '3' downTo '1') != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in '3' downTo '1') != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if ('1' in '3' downTo '1' != range0.contains('1')) throw AssertionError() + if ('1' !in '3' downTo '1' != !range0.contains('1')) throw AssertionError() + if (!('1' in '3' downTo '1') != !range0.contains('1')) throw AssertionError() + if (!('1' !in '3' downTo '1') != range0.contains('1')) throw AssertionError() + // no local optimizations + if (element1 in '3' downTo '1' != range0.contains(element1)) throw AssertionError() + if (element1 !in '3' downTo '1' != !range0.contains(element1)) throw AssertionError() + if (!(element1 in '3' downTo '1') != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in '3' downTo '1') != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if ('2' in '3' downTo '1' != range0.contains('2')) throw AssertionError() + if ('2' !in '3' downTo '1' != !range0.contains('2')) throw AssertionError() + if (!('2' in '3' downTo '1') != !range0.contains('2')) throw AssertionError() + if (!('2' !in '3' downTo '1') != range0.contains('2')) throw AssertionError() + // no local optimizations + if (element2 in '3' downTo '1' != range0.contains(element2)) throw AssertionError() + if (element2 !in '3' downTo '1' != !range0.contains(element2)) throw AssertionError() + if (!(element2 in '3' downTo '1') != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in '3' downTo '1') != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if ('3' in '3' downTo '1' != range0.contains('3')) throw AssertionError() + if ('3' !in '3' downTo '1' != !range0.contains('3')) throw AssertionError() + if (!('3' in '3' downTo '1') != !range0.contains('3')) throw AssertionError() + if (!('3' !in '3' downTo '1') != range0.contains('3')) throw AssertionError() + // no local optimizations + if (element3 in '3' downTo '1' != range0.contains(element3)) throw AssertionError() + if (element3 !in '3' downTo '1' != !range0.contains(element3)) throw AssertionError() + if (!(element3 in '3' downTo '1') != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in '3' downTo '1') != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if ('4' in '3' downTo '1' != range0.contains('4')) throw AssertionError() + if ('4' !in '3' downTo '1' != !range0.contains('4')) throw AssertionError() + if (!('4' in '3' downTo '1') != !range0.contains('4')) throw AssertionError() + if (!('4' !in '3' downTo '1') != range0.contains('4')) throw AssertionError() + // no local optimizations + if (element4 in '3' downTo '1' != range0.contains(element4)) throw AssertionError() + if (element4 !in '3' downTo '1' != !range0.contains(element4)) throw AssertionError() + if (!(element4 in '3' downTo '1') != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in '3' downTo '1') != range0.contains(element4)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if ('0' in '1' downTo '3' != range1.contains('0')) throw AssertionError() + if ('0' !in '1' downTo '3' != !range1.contains('0')) throw AssertionError() + if (!('0' in '1' downTo '3') != !range1.contains('0')) throw AssertionError() + if (!('0' !in '1' downTo '3') != range1.contains('0')) throw AssertionError() + // no local optimizations + if (element0 in '1' downTo '3' != range1.contains(element0)) throw AssertionError() + if (element0 !in '1' downTo '3' != !range1.contains(element0)) throw AssertionError() + if (!(element0 in '1' downTo '3') != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in '1' downTo '3') != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if ('1' in '1' downTo '3' != range1.contains('1')) throw AssertionError() + if ('1' !in '1' downTo '3' != !range1.contains('1')) throw AssertionError() + if (!('1' in '1' downTo '3') != !range1.contains('1')) throw AssertionError() + if (!('1' !in '1' downTo '3') != range1.contains('1')) throw AssertionError() + // no local optimizations + if (element1 in '1' downTo '3' != range1.contains(element1)) throw AssertionError() + if (element1 !in '1' downTo '3' != !range1.contains(element1)) throw AssertionError() + if (!(element1 in '1' downTo '3') != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in '1' downTo '3') != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if ('2' in '1' downTo '3' != range1.contains('2')) throw AssertionError() + if ('2' !in '1' downTo '3' != !range1.contains('2')) throw AssertionError() + if (!('2' in '1' downTo '3') != !range1.contains('2')) throw AssertionError() + if (!('2' !in '1' downTo '3') != range1.contains('2')) throw AssertionError() + // no local optimizations + if (element2 in '1' downTo '3' != range1.contains(element2)) throw AssertionError() + if (element2 !in '1' downTo '3' != !range1.contains(element2)) throw AssertionError() + if (!(element2 in '1' downTo '3') != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in '1' downTo '3') != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if ('3' in '1' downTo '3' != range1.contains('3')) throw AssertionError() + if ('3' !in '1' downTo '3' != !range1.contains('3')) throw AssertionError() + if (!('3' in '1' downTo '3') != !range1.contains('3')) throw AssertionError() + if (!('3' !in '1' downTo '3') != range1.contains('3')) throw AssertionError() + // no local optimizations + if (element3 in '1' downTo '3' != range1.contains(element3)) throw AssertionError() + if (element3 !in '1' downTo '3' != !range1.contains(element3)) throw AssertionError() + if (!(element3 in '1' downTo '3') != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in '1' downTo '3') != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if ('4' in '1' downTo '3' != range1.contains('4')) throw AssertionError() + if ('4' !in '1' downTo '3' != !range1.contains('4')) throw AssertionError() + if (!('4' in '1' downTo '3') != !range1.contains('4')) throw AssertionError() + if (!('4' !in '1' downTo '3') != range1.contains('4')) throw AssertionError() + // no local optimizations + if (element4 in '1' downTo '3' != range1.contains(element4)) throw AssertionError() + if (element4 !in '1' downTo '3' != !range1.contains(element4)) throw AssertionError() + if (!(element4 in '1' downTo '3') != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in '1' downTo '3') != range1.contains(element4)) throw AssertionError() +} + + diff --git a/backend.native/tests/external/codegen/box/ranges/contains/generated/charRangeLiteral.kt b/backend.native/tests/external/codegen/box/ranges/contains/generated/charRangeLiteral.kt new file mode 100644 index 00000000000..ba93f6b044d --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/generated/charRangeLiteral.kt @@ -0,0 +1,159 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_RUNTIME + + + +val range0 = '1' .. '3' +val range1 = '3' .. '1' + +val element0 = '0' +val element1 = '1' +val element2 = '2' +val element3 = '3' +val element4 = '4' + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if ('0' in '1' .. '3' != range0.contains('0')) throw AssertionError() + if ('0' !in '1' .. '3' != !range0.contains('0')) throw AssertionError() + if (!('0' in '1' .. '3') != !range0.contains('0')) throw AssertionError() + if (!('0' !in '1' .. '3') != range0.contains('0')) throw AssertionError() + // no local optimizations + if (element0 in '1' .. '3' != range0.contains(element0)) throw AssertionError() + if (element0 !in '1' .. '3' != !range0.contains(element0)) throw AssertionError() + if (!(element0 in '1' .. '3') != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in '1' .. '3') != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if ('1' in '1' .. '3' != range0.contains('1')) throw AssertionError() + if ('1' !in '1' .. '3' != !range0.contains('1')) throw AssertionError() + if (!('1' in '1' .. '3') != !range0.contains('1')) throw AssertionError() + if (!('1' !in '1' .. '3') != range0.contains('1')) throw AssertionError() + // no local optimizations + if (element1 in '1' .. '3' != range0.contains(element1)) throw AssertionError() + if (element1 !in '1' .. '3' != !range0.contains(element1)) throw AssertionError() + if (!(element1 in '1' .. '3') != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in '1' .. '3') != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if ('2' in '1' .. '3' != range0.contains('2')) throw AssertionError() + if ('2' !in '1' .. '3' != !range0.contains('2')) throw AssertionError() + if (!('2' in '1' .. '3') != !range0.contains('2')) throw AssertionError() + if (!('2' !in '1' .. '3') != range0.contains('2')) throw AssertionError() + // no local optimizations + if (element2 in '1' .. '3' != range0.contains(element2)) throw AssertionError() + if (element2 !in '1' .. '3' != !range0.contains(element2)) throw AssertionError() + if (!(element2 in '1' .. '3') != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in '1' .. '3') != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if ('3' in '1' .. '3' != range0.contains('3')) throw AssertionError() + if ('3' !in '1' .. '3' != !range0.contains('3')) throw AssertionError() + if (!('3' in '1' .. '3') != !range0.contains('3')) throw AssertionError() + if (!('3' !in '1' .. '3') != range0.contains('3')) throw AssertionError() + // no local optimizations + if (element3 in '1' .. '3' != range0.contains(element3)) throw AssertionError() + if (element3 !in '1' .. '3' != !range0.contains(element3)) throw AssertionError() + if (!(element3 in '1' .. '3') != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in '1' .. '3') != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if ('4' in '1' .. '3' != range0.contains('4')) throw AssertionError() + if ('4' !in '1' .. '3' != !range0.contains('4')) throw AssertionError() + if (!('4' in '1' .. '3') != !range0.contains('4')) throw AssertionError() + if (!('4' !in '1' .. '3') != range0.contains('4')) throw AssertionError() + // no local optimizations + if (element4 in '1' .. '3' != range0.contains(element4)) throw AssertionError() + if (element4 !in '1' .. '3' != !range0.contains(element4)) throw AssertionError() + if (!(element4 in '1' .. '3') != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in '1' .. '3') != range0.contains(element4)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if ('0' in '3' .. '1' != range1.contains('0')) throw AssertionError() + if ('0' !in '3' .. '1' != !range1.contains('0')) throw AssertionError() + if (!('0' in '3' .. '1') != !range1.contains('0')) throw AssertionError() + if (!('0' !in '3' .. '1') != range1.contains('0')) throw AssertionError() + // no local optimizations + if (element0 in '3' .. '1' != range1.contains(element0)) throw AssertionError() + if (element0 !in '3' .. '1' != !range1.contains(element0)) throw AssertionError() + if (!(element0 in '3' .. '1') != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in '3' .. '1') != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if ('1' in '3' .. '1' != range1.contains('1')) throw AssertionError() + if ('1' !in '3' .. '1' != !range1.contains('1')) throw AssertionError() + if (!('1' in '3' .. '1') != !range1.contains('1')) throw AssertionError() + if (!('1' !in '3' .. '1') != range1.contains('1')) throw AssertionError() + // no local optimizations + if (element1 in '3' .. '1' != range1.contains(element1)) throw AssertionError() + if (element1 !in '3' .. '1' != !range1.contains(element1)) throw AssertionError() + if (!(element1 in '3' .. '1') != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in '3' .. '1') != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if ('2' in '3' .. '1' != range1.contains('2')) throw AssertionError() + if ('2' !in '3' .. '1' != !range1.contains('2')) throw AssertionError() + if (!('2' in '3' .. '1') != !range1.contains('2')) throw AssertionError() + if (!('2' !in '3' .. '1') != range1.contains('2')) throw AssertionError() + // no local optimizations + if (element2 in '3' .. '1' != range1.contains(element2)) throw AssertionError() + if (element2 !in '3' .. '1' != !range1.contains(element2)) throw AssertionError() + if (!(element2 in '3' .. '1') != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in '3' .. '1') != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if ('3' in '3' .. '1' != range1.contains('3')) throw AssertionError() + if ('3' !in '3' .. '1' != !range1.contains('3')) throw AssertionError() + if (!('3' in '3' .. '1') != !range1.contains('3')) throw AssertionError() + if (!('3' !in '3' .. '1') != range1.contains('3')) throw AssertionError() + // no local optimizations + if (element3 in '3' .. '1' != range1.contains(element3)) throw AssertionError() + if (element3 !in '3' .. '1' != !range1.contains(element3)) throw AssertionError() + if (!(element3 in '3' .. '1') != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in '3' .. '1') != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if ('4' in '3' .. '1' != range1.contains('4')) throw AssertionError() + if ('4' !in '3' .. '1' != !range1.contains('4')) throw AssertionError() + if (!('4' in '3' .. '1') != !range1.contains('4')) throw AssertionError() + if (!('4' !in '3' .. '1') != range1.contains('4')) throw AssertionError() + // no local optimizations + if (element4 in '3' .. '1' != range1.contains(element4)) throw AssertionError() + if (element4 !in '3' .. '1' != !range1.contains(element4)) throw AssertionError() + if (!(element4 in '3' .. '1') != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in '3' .. '1') != range1.contains(element4)) throw AssertionError() +} + + diff --git a/backend.native/tests/external/codegen/box/ranges/contains/generated/charSequenceIndices.kt b/backend.native/tests/external/codegen/box/ranges/contains/generated/charSequenceIndices.kt new file mode 100644 index 00000000000..7f6d4ac8921 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/generated/charSequenceIndices.kt @@ -0,0 +1,1059 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_RUNTIME + +val charSequence: CharSequence = "123" +val emptyCharSequence: CharSequence = "" + +val range0 = charSequence.indices +val range1 = emptyCharSequence.indices + +val element0 = (-1).toByte() +val element1 = (-1).toShort() +val element2 = (-1) +val element3 = (-1).toLong() +val element4 = (-1).toFloat() +val element5 = (-1).toDouble() +val element6 = 0.toByte() +val element7 = 0.toShort() +val element8 = 0 +val element9 = 0.toLong() +val element10 = 0.toFloat() +val element11 = 0.toDouble() +val element12 = 1.toByte() +val element13 = 1.toShort() +val element14 = 1 +val element15 = 1.toLong() +val element16 = 1.toFloat() +val element17 = 1.toDouble() +val element18 = 2.toByte() +val element19 = 2.toShort() +val element20 = 2 +val element21 = 2.toLong() +val element22 = 2.toFloat() +val element23 = 2.toDouble() +val element24 = 3.toByte() +val element25 = 3.toShort() +val element26 = 3 +val element27 = 3.toLong() +val element28 = 3.toFloat() +val element29 = 3.toDouble() +val element30 = 4.toByte() +val element31 = 4.toShort() +val element32 = 4 +val element33 = 4.toLong() +val element34 = 4.toFloat() +val element35 = 4.toDouble() + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR0xE5() + testR0xE6() + testR0xE7() + testR0xE8() + testR0xE9() + testR0xE10() + testR0xE11() + testR0xE12() + testR0xE13() + testR0xE14() + testR0xE15() + testR0xE16() + testR0xE17() + testR0xE18() + testR0xE19() + testR0xE20() + testR0xE21() + testR0xE22() + testR0xE23() + testR0xE24() + testR0xE25() + testR0xE26() + testR0xE27() + testR0xE28() + testR0xE29() + testR0xE30() + testR0xE31() + testR0xE32() + testR0xE33() + testR0xE34() + testR0xE35() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + testR1xE5() + testR1xE6() + testR1xE7() + testR1xE8() + testR1xE9() + testR1xE10() + testR1xE11() + testR1xE12() + testR1xE13() + testR1xE14() + testR1xE15() + testR1xE16() + testR1xE17() + testR1xE18() + testR1xE19() + testR1xE20() + testR1xE21() + testR1xE22() + testR1xE23() + testR1xE24() + testR1xE25() + testR1xE26() + testR1xE27() + testR1xE28() + testR1xE29() + testR1xE30() + testR1xE31() + testR1xE32() + testR1xE33() + testR1xE34() + testR1xE35() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if ((-1).toByte() in charSequence.indices != range0.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in charSequence.indices != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in charSequence.indices) != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in charSequence.indices) != range0.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in charSequence.indices != range0.contains(element0)) throw AssertionError() + if (element0 !in charSequence.indices != !range0.contains(element0)) throw AssertionError() + if (!(element0 in charSequence.indices) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in charSequence.indices) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if ((-1).toShort() in charSequence.indices != range0.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in charSequence.indices != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in charSequence.indices) != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in charSequence.indices) != range0.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in charSequence.indices != range0.contains(element1)) throw AssertionError() + if (element1 !in charSequence.indices != !range0.contains(element1)) throw AssertionError() + if (!(element1 in charSequence.indices) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in charSequence.indices) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if ((-1) in charSequence.indices != range0.contains((-1))) throw AssertionError() + if ((-1) !in charSequence.indices != !range0.contains((-1))) throw AssertionError() + if (!((-1) in charSequence.indices) != !range0.contains((-1))) throw AssertionError() + if (!((-1) !in charSequence.indices) != range0.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in charSequence.indices != range0.contains(element2)) throw AssertionError() + if (element2 !in charSequence.indices != !range0.contains(element2)) throw AssertionError() + if (!(element2 in charSequence.indices) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in charSequence.indices) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if ((-1).toLong() in charSequence.indices != range0.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in charSequence.indices != !range0.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in charSequence.indices) != !range0.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in charSequence.indices) != range0.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in charSequence.indices != range0.contains(element3)) throw AssertionError() + if (element3 !in charSequence.indices != !range0.contains(element3)) throw AssertionError() + if (!(element3 in charSequence.indices) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in charSequence.indices) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if ((-1).toFloat() in charSequence.indices != range0.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in charSequence.indices != !range0.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in charSequence.indices) != !range0.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in charSequence.indices) != range0.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in charSequence.indices != range0.contains(element4)) throw AssertionError() + if (element4 !in charSequence.indices != !range0.contains(element4)) throw AssertionError() + if (!(element4 in charSequence.indices) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in charSequence.indices) != range0.contains(element4)) throw AssertionError() +} + +fun testR0xE5() { + // with possible local optimizations + if ((-1).toDouble() in charSequence.indices != range0.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in charSequence.indices != !range0.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in charSequence.indices) != !range0.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in charSequence.indices) != range0.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in charSequence.indices != range0.contains(element5)) throw AssertionError() + if (element5 !in charSequence.indices != !range0.contains(element5)) throw AssertionError() + if (!(element5 in charSequence.indices) != !range0.contains(element5)) throw AssertionError() + if (!(element5 !in charSequence.indices) != range0.contains(element5)) throw AssertionError() +} + +fun testR0xE6() { + // with possible local optimizations + if (0.toByte() in charSequence.indices != range0.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in charSequence.indices != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in charSequence.indices) != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in charSequence.indices) != range0.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in charSequence.indices != range0.contains(element6)) throw AssertionError() + if (element6 !in charSequence.indices != !range0.contains(element6)) throw AssertionError() + if (!(element6 in charSequence.indices) != !range0.contains(element6)) throw AssertionError() + if (!(element6 !in charSequence.indices) != range0.contains(element6)) throw AssertionError() +} + +fun testR0xE7() { + // with possible local optimizations + if (0.toShort() in charSequence.indices != range0.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in charSequence.indices != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in charSequence.indices) != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in charSequence.indices) != range0.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in charSequence.indices != range0.contains(element7)) throw AssertionError() + if (element7 !in charSequence.indices != !range0.contains(element7)) throw AssertionError() + if (!(element7 in charSequence.indices) != !range0.contains(element7)) throw AssertionError() + if (!(element7 !in charSequence.indices) != range0.contains(element7)) throw AssertionError() +} + +fun testR0xE8() { + // with possible local optimizations + if (0 in charSequence.indices != range0.contains(0)) throw AssertionError() + if (0 !in charSequence.indices != !range0.contains(0)) throw AssertionError() + if (!(0 in charSequence.indices) != !range0.contains(0)) throw AssertionError() + if (!(0 !in charSequence.indices) != range0.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in charSequence.indices != range0.contains(element8)) throw AssertionError() + if (element8 !in charSequence.indices != !range0.contains(element8)) throw AssertionError() + if (!(element8 in charSequence.indices) != !range0.contains(element8)) throw AssertionError() + if (!(element8 !in charSequence.indices) != range0.contains(element8)) throw AssertionError() +} + +fun testR0xE9() { + // with possible local optimizations + if (0.toLong() in charSequence.indices != range0.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in charSequence.indices != !range0.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in charSequence.indices) != !range0.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in charSequence.indices) != range0.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in charSequence.indices != range0.contains(element9)) throw AssertionError() + if (element9 !in charSequence.indices != !range0.contains(element9)) throw AssertionError() + if (!(element9 in charSequence.indices) != !range0.contains(element9)) throw AssertionError() + if (!(element9 !in charSequence.indices) != range0.contains(element9)) throw AssertionError() +} + +fun testR0xE10() { + // with possible local optimizations + if (0.toFloat() in charSequence.indices != range0.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in charSequence.indices != !range0.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in charSequence.indices) != !range0.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in charSequence.indices) != range0.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in charSequence.indices != range0.contains(element10)) throw AssertionError() + if (element10 !in charSequence.indices != !range0.contains(element10)) throw AssertionError() + if (!(element10 in charSequence.indices) != !range0.contains(element10)) throw AssertionError() + if (!(element10 !in charSequence.indices) != range0.contains(element10)) throw AssertionError() +} + +fun testR0xE11() { + // with possible local optimizations + if (0.toDouble() in charSequence.indices != range0.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in charSequence.indices != !range0.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in charSequence.indices) != !range0.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in charSequence.indices) != range0.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in charSequence.indices != range0.contains(element11)) throw AssertionError() + if (element11 !in charSequence.indices != !range0.contains(element11)) throw AssertionError() + if (!(element11 in charSequence.indices) != !range0.contains(element11)) throw AssertionError() + if (!(element11 !in charSequence.indices) != range0.contains(element11)) throw AssertionError() +} + +fun testR0xE12() { + // with possible local optimizations + if (1.toByte() in charSequence.indices != range0.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in charSequence.indices != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in charSequence.indices) != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in charSequence.indices) != range0.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in charSequence.indices != range0.contains(element12)) throw AssertionError() + if (element12 !in charSequence.indices != !range0.contains(element12)) throw AssertionError() + if (!(element12 in charSequence.indices) != !range0.contains(element12)) throw AssertionError() + if (!(element12 !in charSequence.indices) != range0.contains(element12)) throw AssertionError() +} + +fun testR0xE13() { + // with possible local optimizations + if (1.toShort() in charSequence.indices != range0.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in charSequence.indices != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in charSequence.indices) != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in charSequence.indices) != range0.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in charSequence.indices != range0.contains(element13)) throw AssertionError() + if (element13 !in charSequence.indices != !range0.contains(element13)) throw AssertionError() + if (!(element13 in charSequence.indices) != !range0.contains(element13)) throw AssertionError() + if (!(element13 !in charSequence.indices) != range0.contains(element13)) throw AssertionError() +} + +fun testR0xE14() { + // with possible local optimizations + if (1 in charSequence.indices != range0.contains(1)) throw AssertionError() + if (1 !in charSequence.indices != !range0.contains(1)) throw AssertionError() + if (!(1 in charSequence.indices) != !range0.contains(1)) throw AssertionError() + if (!(1 !in charSequence.indices) != range0.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in charSequence.indices != range0.contains(element14)) throw AssertionError() + if (element14 !in charSequence.indices != !range0.contains(element14)) throw AssertionError() + if (!(element14 in charSequence.indices) != !range0.contains(element14)) throw AssertionError() + if (!(element14 !in charSequence.indices) != range0.contains(element14)) throw AssertionError() +} + +fun testR0xE15() { + // with possible local optimizations + if (1.toLong() in charSequence.indices != range0.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in charSequence.indices != !range0.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in charSequence.indices) != !range0.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in charSequence.indices) != range0.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in charSequence.indices != range0.contains(element15)) throw AssertionError() + if (element15 !in charSequence.indices != !range0.contains(element15)) throw AssertionError() + if (!(element15 in charSequence.indices) != !range0.contains(element15)) throw AssertionError() + if (!(element15 !in charSequence.indices) != range0.contains(element15)) throw AssertionError() +} + +fun testR0xE16() { + // with possible local optimizations + if (1.toFloat() in charSequence.indices != range0.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in charSequence.indices != !range0.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in charSequence.indices) != !range0.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in charSequence.indices) != range0.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in charSequence.indices != range0.contains(element16)) throw AssertionError() + if (element16 !in charSequence.indices != !range0.contains(element16)) throw AssertionError() + if (!(element16 in charSequence.indices) != !range0.contains(element16)) throw AssertionError() + if (!(element16 !in charSequence.indices) != range0.contains(element16)) throw AssertionError() +} + +fun testR0xE17() { + // with possible local optimizations + if (1.toDouble() in charSequence.indices != range0.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in charSequence.indices != !range0.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in charSequence.indices) != !range0.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in charSequence.indices) != range0.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in charSequence.indices != range0.contains(element17)) throw AssertionError() + if (element17 !in charSequence.indices != !range0.contains(element17)) throw AssertionError() + if (!(element17 in charSequence.indices) != !range0.contains(element17)) throw AssertionError() + if (!(element17 !in charSequence.indices) != range0.contains(element17)) throw AssertionError() +} + +fun testR0xE18() { + // with possible local optimizations + if (2.toByte() in charSequence.indices != range0.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in charSequence.indices != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in charSequence.indices) != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in charSequence.indices) != range0.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in charSequence.indices != range0.contains(element18)) throw AssertionError() + if (element18 !in charSequence.indices != !range0.contains(element18)) throw AssertionError() + if (!(element18 in charSequence.indices) != !range0.contains(element18)) throw AssertionError() + if (!(element18 !in charSequence.indices) != range0.contains(element18)) throw AssertionError() +} + +fun testR0xE19() { + // with possible local optimizations + if (2.toShort() in charSequence.indices != range0.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in charSequence.indices != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in charSequence.indices) != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in charSequence.indices) != range0.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in charSequence.indices != range0.contains(element19)) throw AssertionError() + if (element19 !in charSequence.indices != !range0.contains(element19)) throw AssertionError() + if (!(element19 in charSequence.indices) != !range0.contains(element19)) throw AssertionError() + if (!(element19 !in charSequence.indices) != range0.contains(element19)) throw AssertionError() +} + +fun testR0xE20() { + // with possible local optimizations + if (2 in charSequence.indices != range0.contains(2)) throw AssertionError() + if (2 !in charSequence.indices != !range0.contains(2)) throw AssertionError() + if (!(2 in charSequence.indices) != !range0.contains(2)) throw AssertionError() + if (!(2 !in charSequence.indices) != range0.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in charSequence.indices != range0.contains(element20)) throw AssertionError() + if (element20 !in charSequence.indices != !range0.contains(element20)) throw AssertionError() + if (!(element20 in charSequence.indices) != !range0.contains(element20)) throw AssertionError() + if (!(element20 !in charSequence.indices) != range0.contains(element20)) throw AssertionError() +} + +fun testR0xE21() { + // with possible local optimizations + if (2.toLong() in charSequence.indices != range0.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in charSequence.indices != !range0.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in charSequence.indices) != !range0.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in charSequence.indices) != range0.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in charSequence.indices != range0.contains(element21)) throw AssertionError() + if (element21 !in charSequence.indices != !range0.contains(element21)) throw AssertionError() + if (!(element21 in charSequence.indices) != !range0.contains(element21)) throw AssertionError() + if (!(element21 !in charSequence.indices) != range0.contains(element21)) throw AssertionError() +} + +fun testR0xE22() { + // with possible local optimizations + if (2.toFloat() in charSequence.indices != range0.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in charSequence.indices != !range0.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in charSequence.indices) != !range0.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in charSequence.indices) != range0.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in charSequence.indices != range0.contains(element22)) throw AssertionError() + if (element22 !in charSequence.indices != !range0.contains(element22)) throw AssertionError() + if (!(element22 in charSequence.indices) != !range0.contains(element22)) throw AssertionError() + if (!(element22 !in charSequence.indices) != range0.contains(element22)) throw AssertionError() +} + +fun testR0xE23() { + // with possible local optimizations + if (2.toDouble() in charSequence.indices != range0.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in charSequence.indices != !range0.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in charSequence.indices) != !range0.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in charSequence.indices) != range0.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in charSequence.indices != range0.contains(element23)) throw AssertionError() + if (element23 !in charSequence.indices != !range0.contains(element23)) throw AssertionError() + if (!(element23 in charSequence.indices) != !range0.contains(element23)) throw AssertionError() + if (!(element23 !in charSequence.indices) != range0.contains(element23)) throw AssertionError() +} + +fun testR0xE24() { + // with possible local optimizations + if (3.toByte() in charSequence.indices != range0.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in charSequence.indices != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in charSequence.indices) != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in charSequence.indices) != range0.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in charSequence.indices != range0.contains(element24)) throw AssertionError() + if (element24 !in charSequence.indices != !range0.contains(element24)) throw AssertionError() + if (!(element24 in charSequence.indices) != !range0.contains(element24)) throw AssertionError() + if (!(element24 !in charSequence.indices) != range0.contains(element24)) throw AssertionError() +} + +fun testR0xE25() { + // with possible local optimizations + if (3.toShort() in charSequence.indices != range0.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in charSequence.indices != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in charSequence.indices) != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in charSequence.indices) != range0.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in charSequence.indices != range0.contains(element25)) throw AssertionError() + if (element25 !in charSequence.indices != !range0.contains(element25)) throw AssertionError() + if (!(element25 in charSequence.indices) != !range0.contains(element25)) throw AssertionError() + if (!(element25 !in charSequence.indices) != range0.contains(element25)) throw AssertionError() +} + +fun testR0xE26() { + // with possible local optimizations + if (3 in charSequence.indices != range0.contains(3)) throw AssertionError() + if (3 !in charSequence.indices != !range0.contains(3)) throw AssertionError() + if (!(3 in charSequence.indices) != !range0.contains(3)) throw AssertionError() + if (!(3 !in charSequence.indices) != range0.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in charSequence.indices != range0.contains(element26)) throw AssertionError() + if (element26 !in charSequence.indices != !range0.contains(element26)) throw AssertionError() + if (!(element26 in charSequence.indices) != !range0.contains(element26)) throw AssertionError() + if (!(element26 !in charSequence.indices) != range0.contains(element26)) throw AssertionError() +} + +fun testR0xE27() { + // with possible local optimizations + if (3.toLong() in charSequence.indices != range0.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in charSequence.indices != !range0.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in charSequence.indices) != !range0.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in charSequence.indices) != range0.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in charSequence.indices != range0.contains(element27)) throw AssertionError() + if (element27 !in charSequence.indices != !range0.contains(element27)) throw AssertionError() + if (!(element27 in charSequence.indices) != !range0.contains(element27)) throw AssertionError() + if (!(element27 !in charSequence.indices) != range0.contains(element27)) throw AssertionError() +} + +fun testR0xE28() { + // with possible local optimizations + if (3.toFloat() in charSequence.indices != range0.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in charSequence.indices != !range0.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in charSequence.indices) != !range0.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in charSequence.indices) != range0.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in charSequence.indices != range0.contains(element28)) throw AssertionError() + if (element28 !in charSequence.indices != !range0.contains(element28)) throw AssertionError() + if (!(element28 in charSequence.indices) != !range0.contains(element28)) throw AssertionError() + if (!(element28 !in charSequence.indices) != range0.contains(element28)) throw AssertionError() +} + +fun testR0xE29() { + // with possible local optimizations + if (3.toDouble() in charSequence.indices != range0.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in charSequence.indices != !range0.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in charSequence.indices) != !range0.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in charSequence.indices) != range0.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in charSequence.indices != range0.contains(element29)) throw AssertionError() + if (element29 !in charSequence.indices != !range0.contains(element29)) throw AssertionError() + if (!(element29 in charSequence.indices) != !range0.contains(element29)) throw AssertionError() + if (!(element29 !in charSequence.indices) != range0.contains(element29)) throw AssertionError() +} + +fun testR0xE30() { + // with possible local optimizations + if (4.toByte() in charSequence.indices != range0.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in charSequence.indices != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in charSequence.indices) != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in charSequence.indices) != range0.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in charSequence.indices != range0.contains(element30)) throw AssertionError() + if (element30 !in charSequence.indices != !range0.contains(element30)) throw AssertionError() + if (!(element30 in charSequence.indices) != !range0.contains(element30)) throw AssertionError() + if (!(element30 !in charSequence.indices) != range0.contains(element30)) throw AssertionError() +} + +fun testR0xE31() { + // with possible local optimizations + if (4.toShort() in charSequence.indices != range0.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in charSequence.indices != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in charSequence.indices) != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in charSequence.indices) != range0.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in charSequence.indices != range0.contains(element31)) throw AssertionError() + if (element31 !in charSequence.indices != !range0.contains(element31)) throw AssertionError() + if (!(element31 in charSequence.indices) != !range0.contains(element31)) throw AssertionError() + if (!(element31 !in charSequence.indices) != range0.contains(element31)) throw AssertionError() +} + +fun testR0xE32() { + // with possible local optimizations + if (4 in charSequence.indices != range0.contains(4)) throw AssertionError() + if (4 !in charSequence.indices != !range0.contains(4)) throw AssertionError() + if (!(4 in charSequence.indices) != !range0.contains(4)) throw AssertionError() + if (!(4 !in charSequence.indices) != range0.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in charSequence.indices != range0.contains(element32)) throw AssertionError() + if (element32 !in charSequence.indices != !range0.contains(element32)) throw AssertionError() + if (!(element32 in charSequence.indices) != !range0.contains(element32)) throw AssertionError() + if (!(element32 !in charSequence.indices) != range0.contains(element32)) throw AssertionError() +} + +fun testR0xE33() { + // with possible local optimizations + if (4.toLong() in charSequence.indices != range0.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in charSequence.indices != !range0.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in charSequence.indices) != !range0.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in charSequence.indices) != range0.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in charSequence.indices != range0.contains(element33)) throw AssertionError() + if (element33 !in charSequence.indices != !range0.contains(element33)) throw AssertionError() + if (!(element33 in charSequence.indices) != !range0.contains(element33)) throw AssertionError() + if (!(element33 !in charSequence.indices) != range0.contains(element33)) throw AssertionError() +} + +fun testR0xE34() { + // with possible local optimizations + if (4.toFloat() in charSequence.indices != range0.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in charSequence.indices != !range0.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in charSequence.indices) != !range0.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in charSequence.indices) != range0.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in charSequence.indices != range0.contains(element34)) throw AssertionError() + if (element34 !in charSequence.indices != !range0.contains(element34)) throw AssertionError() + if (!(element34 in charSequence.indices) != !range0.contains(element34)) throw AssertionError() + if (!(element34 !in charSequence.indices) != range0.contains(element34)) throw AssertionError() +} + +fun testR0xE35() { + // with possible local optimizations + if (4.toDouble() in charSequence.indices != range0.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in charSequence.indices != !range0.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in charSequence.indices) != !range0.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in charSequence.indices) != range0.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in charSequence.indices != range0.contains(element35)) throw AssertionError() + if (element35 !in charSequence.indices != !range0.contains(element35)) throw AssertionError() + if (!(element35 in charSequence.indices) != !range0.contains(element35)) throw AssertionError() + if (!(element35 !in charSequence.indices) != range0.contains(element35)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if ((-1).toByte() in emptyCharSequence.indices != range1.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in emptyCharSequence.indices != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in emptyCharSequence.indices) != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in emptyCharSequence.indices) != range1.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in emptyCharSequence.indices != range1.contains(element0)) throw AssertionError() + if (element0 !in emptyCharSequence.indices != !range1.contains(element0)) throw AssertionError() + if (!(element0 in emptyCharSequence.indices) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in emptyCharSequence.indices) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if ((-1).toShort() in emptyCharSequence.indices != range1.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in emptyCharSequence.indices != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in emptyCharSequence.indices) != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in emptyCharSequence.indices) != range1.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in emptyCharSequence.indices != range1.contains(element1)) throw AssertionError() + if (element1 !in emptyCharSequence.indices != !range1.contains(element1)) throw AssertionError() + if (!(element1 in emptyCharSequence.indices) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in emptyCharSequence.indices) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if ((-1) in emptyCharSequence.indices != range1.contains((-1))) throw AssertionError() + if ((-1) !in emptyCharSequence.indices != !range1.contains((-1))) throw AssertionError() + if (!((-1) in emptyCharSequence.indices) != !range1.contains((-1))) throw AssertionError() + if (!((-1) !in emptyCharSequence.indices) != range1.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in emptyCharSequence.indices != range1.contains(element2)) throw AssertionError() + if (element2 !in emptyCharSequence.indices != !range1.contains(element2)) throw AssertionError() + if (!(element2 in emptyCharSequence.indices) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in emptyCharSequence.indices) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if ((-1).toLong() in emptyCharSequence.indices != range1.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in emptyCharSequence.indices != !range1.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in emptyCharSequence.indices) != !range1.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in emptyCharSequence.indices) != range1.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in emptyCharSequence.indices != range1.contains(element3)) throw AssertionError() + if (element3 !in emptyCharSequence.indices != !range1.contains(element3)) throw AssertionError() + if (!(element3 in emptyCharSequence.indices) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in emptyCharSequence.indices) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if ((-1).toFloat() in emptyCharSequence.indices != range1.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in emptyCharSequence.indices != !range1.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in emptyCharSequence.indices) != !range1.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in emptyCharSequence.indices) != range1.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in emptyCharSequence.indices != range1.contains(element4)) throw AssertionError() + if (element4 !in emptyCharSequence.indices != !range1.contains(element4)) throw AssertionError() + if (!(element4 in emptyCharSequence.indices) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in emptyCharSequence.indices) != range1.contains(element4)) throw AssertionError() +} + +fun testR1xE5() { + // with possible local optimizations + if ((-1).toDouble() in emptyCharSequence.indices != range1.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in emptyCharSequence.indices != !range1.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in emptyCharSequence.indices) != !range1.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in emptyCharSequence.indices) != range1.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in emptyCharSequence.indices != range1.contains(element5)) throw AssertionError() + if (element5 !in emptyCharSequence.indices != !range1.contains(element5)) throw AssertionError() + if (!(element5 in emptyCharSequence.indices) != !range1.contains(element5)) throw AssertionError() + if (!(element5 !in emptyCharSequence.indices) != range1.contains(element5)) throw AssertionError() +} + +fun testR1xE6() { + // with possible local optimizations + if (0.toByte() in emptyCharSequence.indices != range1.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in emptyCharSequence.indices != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in emptyCharSequence.indices) != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in emptyCharSequence.indices) != range1.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in emptyCharSequence.indices != range1.contains(element6)) throw AssertionError() + if (element6 !in emptyCharSequence.indices != !range1.contains(element6)) throw AssertionError() + if (!(element6 in emptyCharSequence.indices) != !range1.contains(element6)) throw AssertionError() + if (!(element6 !in emptyCharSequence.indices) != range1.contains(element6)) throw AssertionError() +} + +fun testR1xE7() { + // with possible local optimizations + if (0.toShort() in emptyCharSequence.indices != range1.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in emptyCharSequence.indices != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in emptyCharSequence.indices) != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in emptyCharSequence.indices) != range1.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in emptyCharSequence.indices != range1.contains(element7)) throw AssertionError() + if (element7 !in emptyCharSequence.indices != !range1.contains(element7)) throw AssertionError() + if (!(element7 in emptyCharSequence.indices) != !range1.contains(element7)) throw AssertionError() + if (!(element7 !in emptyCharSequence.indices) != range1.contains(element7)) throw AssertionError() +} + +fun testR1xE8() { + // with possible local optimizations + if (0 in emptyCharSequence.indices != range1.contains(0)) throw AssertionError() + if (0 !in emptyCharSequence.indices != !range1.contains(0)) throw AssertionError() + if (!(0 in emptyCharSequence.indices) != !range1.contains(0)) throw AssertionError() + if (!(0 !in emptyCharSequence.indices) != range1.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in emptyCharSequence.indices != range1.contains(element8)) throw AssertionError() + if (element8 !in emptyCharSequence.indices != !range1.contains(element8)) throw AssertionError() + if (!(element8 in emptyCharSequence.indices) != !range1.contains(element8)) throw AssertionError() + if (!(element8 !in emptyCharSequence.indices) != range1.contains(element8)) throw AssertionError() +} + +fun testR1xE9() { + // with possible local optimizations + if (0.toLong() in emptyCharSequence.indices != range1.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in emptyCharSequence.indices != !range1.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in emptyCharSequence.indices) != !range1.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in emptyCharSequence.indices) != range1.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in emptyCharSequence.indices != range1.contains(element9)) throw AssertionError() + if (element9 !in emptyCharSequence.indices != !range1.contains(element9)) throw AssertionError() + if (!(element9 in emptyCharSequence.indices) != !range1.contains(element9)) throw AssertionError() + if (!(element9 !in emptyCharSequence.indices) != range1.contains(element9)) throw AssertionError() +} + +fun testR1xE10() { + // with possible local optimizations + if (0.toFloat() in emptyCharSequence.indices != range1.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in emptyCharSequence.indices != !range1.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in emptyCharSequence.indices) != !range1.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in emptyCharSequence.indices) != range1.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in emptyCharSequence.indices != range1.contains(element10)) throw AssertionError() + if (element10 !in emptyCharSequence.indices != !range1.contains(element10)) throw AssertionError() + if (!(element10 in emptyCharSequence.indices) != !range1.contains(element10)) throw AssertionError() + if (!(element10 !in emptyCharSequence.indices) != range1.contains(element10)) throw AssertionError() +} + +fun testR1xE11() { + // with possible local optimizations + if (0.toDouble() in emptyCharSequence.indices != range1.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in emptyCharSequence.indices != !range1.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in emptyCharSequence.indices) != !range1.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in emptyCharSequence.indices) != range1.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in emptyCharSequence.indices != range1.contains(element11)) throw AssertionError() + if (element11 !in emptyCharSequence.indices != !range1.contains(element11)) throw AssertionError() + if (!(element11 in emptyCharSequence.indices) != !range1.contains(element11)) throw AssertionError() + if (!(element11 !in emptyCharSequence.indices) != range1.contains(element11)) throw AssertionError() +} + +fun testR1xE12() { + // with possible local optimizations + if (1.toByte() in emptyCharSequence.indices != range1.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in emptyCharSequence.indices != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in emptyCharSequence.indices) != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in emptyCharSequence.indices) != range1.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in emptyCharSequence.indices != range1.contains(element12)) throw AssertionError() + if (element12 !in emptyCharSequence.indices != !range1.contains(element12)) throw AssertionError() + if (!(element12 in emptyCharSequence.indices) != !range1.contains(element12)) throw AssertionError() + if (!(element12 !in emptyCharSequence.indices) != range1.contains(element12)) throw AssertionError() +} + +fun testR1xE13() { + // with possible local optimizations + if (1.toShort() in emptyCharSequence.indices != range1.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in emptyCharSequence.indices != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in emptyCharSequence.indices) != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in emptyCharSequence.indices) != range1.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in emptyCharSequence.indices != range1.contains(element13)) throw AssertionError() + if (element13 !in emptyCharSequence.indices != !range1.contains(element13)) throw AssertionError() + if (!(element13 in emptyCharSequence.indices) != !range1.contains(element13)) throw AssertionError() + if (!(element13 !in emptyCharSequence.indices) != range1.contains(element13)) throw AssertionError() +} + +fun testR1xE14() { + // with possible local optimizations + if (1 in emptyCharSequence.indices != range1.contains(1)) throw AssertionError() + if (1 !in emptyCharSequence.indices != !range1.contains(1)) throw AssertionError() + if (!(1 in emptyCharSequence.indices) != !range1.contains(1)) throw AssertionError() + if (!(1 !in emptyCharSequence.indices) != range1.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in emptyCharSequence.indices != range1.contains(element14)) throw AssertionError() + if (element14 !in emptyCharSequence.indices != !range1.contains(element14)) throw AssertionError() + if (!(element14 in emptyCharSequence.indices) != !range1.contains(element14)) throw AssertionError() + if (!(element14 !in emptyCharSequence.indices) != range1.contains(element14)) throw AssertionError() +} + +fun testR1xE15() { + // with possible local optimizations + if (1.toLong() in emptyCharSequence.indices != range1.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in emptyCharSequence.indices != !range1.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in emptyCharSequence.indices) != !range1.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in emptyCharSequence.indices) != range1.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in emptyCharSequence.indices != range1.contains(element15)) throw AssertionError() + if (element15 !in emptyCharSequence.indices != !range1.contains(element15)) throw AssertionError() + if (!(element15 in emptyCharSequence.indices) != !range1.contains(element15)) throw AssertionError() + if (!(element15 !in emptyCharSequence.indices) != range1.contains(element15)) throw AssertionError() +} + +fun testR1xE16() { + // with possible local optimizations + if (1.toFloat() in emptyCharSequence.indices != range1.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in emptyCharSequence.indices != !range1.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in emptyCharSequence.indices) != !range1.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in emptyCharSequence.indices) != range1.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in emptyCharSequence.indices != range1.contains(element16)) throw AssertionError() + if (element16 !in emptyCharSequence.indices != !range1.contains(element16)) throw AssertionError() + if (!(element16 in emptyCharSequence.indices) != !range1.contains(element16)) throw AssertionError() + if (!(element16 !in emptyCharSequence.indices) != range1.contains(element16)) throw AssertionError() +} + +fun testR1xE17() { + // with possible local optimizations + if (1.toDouble() in emptyCharSequence.indices != range1.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in emptyCharSequence.indices != !range1.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in emptyCharSequence.indices) != !range1.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in emptyCharSequence.indices) != range1.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in emptyCharSequence.indices != range1.contains(element17)) throw AssertionError() + if (element17 !in emptyCharSequence.indices != !range1.contains(element17)) throw AssertionError() + if (!(element17 in emptyCharSequence.indices) != !range1.contains(element17)) throw AssertionError() + if (!(element17 !in emptyCharSequence.indices) != range1.contains(element17)) throw AssertionError() +} + +fun testR1xE18() { + // with possible local optimizations + if (2.toByte() in emptyCharSequence.indices != range1.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in emptyCharSequence.indices != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in emptyCharSequence.indices) != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in emptyCharSequence.indices) != range1.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in emptyCharSequence.indices != range1.contains(element18)) throw AssertionError() + if (element18 !in emptyCharSequence.indices != !range1.contains(element18)) throw AssertionError() + if (!(element18 in emptyCharSequence.indices) != !range1.contains(element18)) throw AssertionError() + if (!(element18 !in emptyCharSequence.indices) != range1.contains(element18)) throw AssertionError() +} + +fun testR1xE19() { + // with possible local optimizations + if (2.toShort() in emptyCharSequence.indices != range1.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in emptyCharSequence.indices != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in emptyCharSequence.indices) != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in emptyCharSequence.indices) != range1.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in emptyCharSequence.indices != range1.contains(element19)) throw AssertionError() + if (element19 !in emptyCharSequence.indices != !range1.contains(element19)) throw AssertionError() + if (!(element19 in emptyCharSequence.indices) != !range1.contains(element19)) throw AssertionError() + if (!(element19 !in emptyCharSequence.indices) != range1.contains(element19)) throw AssertionError() +} + +fun testR1xE20() { + // with possible local optimizations + if (2 in emptyCharSequence.indices != range1.contains(2)) throw AssertionError() + if (2 !in emptyCharSequence.indices != !range1.contains(2)) throw AssertionError() + if (!(2 in emptyCharSequence.indices) != !range1.contains(2)) throw AssertionError() + if (!(2 !in emptyCharSequence.indices) != range1.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in emptyCharSequence.indices != range1.contains(element20)) throw AssertionError() + if (element20 !in emptyCharSequence.indices != !range1.contains(element20)) throw AssertionError() + if (!(element20 in emptyCharSequence.indices) != !range1.contains(element20)) throw AssertionError() + if (!(element20 !in emptyCharSequence.indices) != range1.contains(element20)) throw AssertionError() +} + +fun testR1xE21() { + // with possible local optimizations + if (2.toLong() in emptyCharSequence.indices != range1.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in emptyCharSequence.indices != !range1.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in emptyCharSequence.indices) != !range1.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in emptyCharSequence.indices) != range1.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in emptyCharSequence.indices != range1.contains(element21)) throw AssertionError() + if (element21 !in emptyCharSequence.indices != !range1.contains(element21)) throw AssertionError() + if (!(element21 in emptyCharSequence.indices) != !range1.contains(element21)) throw AssertionError() + if (!(element21 !in emptyCharSequence.indices) != range1.contains(element21)) throw AssertionError() +} + +fun testR1xE22() { + // with possible local optimizations + if (2.toFloat() in emptyCharSequence.indices != range1.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in emptyCharSequence.indices != !range1.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in emptyCharSequence.indices) != !range1.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in emptyCharSequence.indices) != range1.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in emptyCharSequence.indices != range1.contains(element22)) throw AssertionError() + if (element22 !in emptyCharSequence.indices != !range1.contains(element22)) throw AssertionError() + if (!(element22 in emptyCharSequence.indices) != !range1.contains(element22)) throw AssertionError() + if (!(element22 !in emptyCharSequence.indices) != range1.contains(element22)) throw AssertionError() +} + +fun testR1xE23() { + // with possible local optimizations + if (2.toDouble() in emptyCharSequence.indices != range1.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in emptyCharSequence.indices != !range1.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in emptyCharSequence.indices) != !range1.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in emptyCharSequence.indices) != range1.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in emptyCharSequence.indices != range1.contains(element23)) throw AssertionError() + if (element23 !in emptyCharSequence.indices != !range1.contains(element23)) throw AssertionError() + if (!(element23 in emptyCharSequence.indices) != !range1.contains(element23)) throw AssertionError() + if (!(element23 !in emptyCharSequence.indices) != range1.contains(element23)) throw AssertionError() +} + +fun testR1xE24() { + // with possible local optimizations + if (3.toByte() in emptyCharSequence.indices != range1.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in emptyCharSequence.indices != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in emptyCharSequence.indices) != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in emptyCharSequence.indices) != range1.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in emptyCharSequence.indices != range1.contains(element24)) throw AssertionError() + if (element24 !in emptyCharSequence.indices != !range1.contains(element24)) throw AssertionError() + if (!(element24 in emptyCharSequence.indices) != !range1.contains(element24)) throw AssertionError() + if (!(element24 !in emptyCharSequence.indices) != range1.contains(element24)) throw AssertionError() +} + +fun testR1xE25() { + // with possible local optimizations + if (3.toShort() in emptyCharSequence.indices != range1.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in emptyCharSequence.indices != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in emptyCharSequence.indices) != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in emptyCharSequence.indices) != range1.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in emptyCharSequence.indices != range1.contains(element25)) throw AssertionError() + if (element25 !in emptyCharSequence.indices != !range1.contains(element25)) throw AssertionError() + if (!(element25 in emptyCharSequence.indices) != !range1.contains(element25)) throw AssertionError() + if (!(element25 !in emptyCharSequence.indices) != range1.contains(element25)) throw AssertionError() +} + +fun testR1xE26() { + // with possible local optimizations + if (3 in emptyCharSequence.indices != range1.contains(3)) throw AssertionError() + if (3 !in emptyCharSequence.indices != !range1.contains(3)) throw AssertionError() + if (!(3 in emptyCharSequence.indices) != !range1.contains(3)) throw AssertionError() + if (!(3 !in emptyCharSequence.indices) != range1.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in emptyCharSequence.indices != range1.contains(element26)) throw AssertionError() + if (element26 !in emptyCharSequence.indices != !range1.contains(element26)) throw AssertionError() + if (!(element26 in emptyCharSequence.indices) != !range1.contains(element26)) throw AssertionError() + if (!(element26 !in emptyCharSequence.indices) != range1.contains(element26)) throw AssertionError() +} + +fun testR1xE27() { + // with possible local optimizations + if (3.toLong() in emptyCharSequence.indices != range1.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in emptyCharSequence.indices != !range1.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in emptyCharSequence.indices) != !range1.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in emptyCharSequence.indices) != range1.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in emptyCharSequence.indices != range1.contains(element27)) throw AssertionError() + if (element27 !in emptyCharSequence.indices != !range1.contains(element27)) throw AssertionError() + if (!(element27 in emptyCharSequence.indices) != !range1.contains(element27)) throw AssertionError() + if (!(element27 !in emptyCharSequence.indices) != range1.contains(element27)) throw AssertionError() +} + +fun testR1xE28() { + // with possible local optimizations + if (3.toFloat() in emptyCharSequence.indices != range1.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in emptyCharSequence.indices != !range1.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in emptyCharSequence.indices) != !range1.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in emptyCharSequence.indices) != range1.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in emptyCharSequence.indices != range1.contains(element28)) throw AssertionError() + if (element28 !in emptyCharSequence.indices != !range1.contains(element28)) throw AssertionError() + if (!(element28 in emptyCharSequence.indices) != !range1.contains(element28)) throw AssertionError() + if (!(element28 !in emptyCharSequence.indices) != range1.contains(element28)) throw AssertionError() +} + +fun testR1xE29() { + // with possible local optimizations + if (3.toDouble() in emptyCharSequence.indices != range1.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in emptyCharSequence.indices != !range1.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in emptyCharSequence.indices) != !range1.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in emptyCharSequence.indices) != range1.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in emptyCharSequence.indices != range1.contains(element29)) throw AssertionError() + if (element29 !in emptyCharSequence.indices != !range1.contains(element29)) throw AssertionError() + if (!(element29 in emptyCharSequence.indices) != !range1.contains(element29)) throw AssertionError() + if (!(element29 !in emptyCharSequence.indices) != range1.contains(element29)) throw AssertionError() +} + +fun testR1xE30() { + // with possible local optimizations + if (4.toByte() in emptyCharSequence.indices != range1.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in emptyCharSequence.indices != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in emptyCharSequence.indices) != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in emptyCharSequence.indices) != range1.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in emptyCharSequence.indices != range1.contains(element30)) throw AssertionError() + if (element30 !in emptyCharSequence.indices != !range1.contains(element30)) throw AssertionError() + if (!(element30 in emptyCharSequence.indices) != !range1.contains(element30)) throw AssertionError() + if (!(element30 !in emptyCharSequence.indices) != range1.contains(element30)) throw AssertionError() +} + +fun testR1xE31() { + // with possible local optimizations + if (4.toShort() in emptyCharSequence.indices != range1.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in emptyCharSequence.indices != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in emptyCharSequence.indices) != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in emptyCharSequence.indices) != range1.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in emptyCharSequence.indices != range1.contains(element31)) throw AssertionError() + if (element31 !in emptyCharSequence.indices != !range1.contains(element31)) throw AssertionError() + if (!(element31 in emptyCharSequence.indices) != !range1.contains(element31)) throw AssertionError() + if (!(element31 !in emptyCharSequence.indices) != range1.contains(element31)) throw AssertionError() +} + +fun testR1xE32() { + // with possible local optimizations + if (4 in emptyCharSequence.indices != range1.contains(4)) throw AssertionError() + if (4 !in emptyCharSequence.indices != !range1.contains(4)) throw AssertionError() + if (!(4 in emptyCharSequence.indices) != !range1.contains(4)) throw AssertionError() + if (!(4 !in emptyCharSequence.indices) != range1.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in emptyCharSequence.indices != range1.contains(element32)) throw AssertionError() + if (element32 !in emptyCharSequence.indices != !range1.contains(element32)) throw AssertionError() + if (!(element32 in emptyCharSequence.indices) != !range1.contains(element32)) throw AssertionError() + if (!(element32 !in emptyCharSequence.indices) != range1.contains(element32)) throw AssertionError() +} + +fun testR1xE33() { + // with possible local optimizations + if (4.toLong() in emptyCharSequence.indices != range1.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in emptyCharSequence.indices != !range1.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in emptyCharSequence.indices) != !range1.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in emptyCharSequence.indices) != range1.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in emptyCharSequence.indices != range1.contains(element33)) throw AssertionError() + if (element33 !in emptyCharSequence.indices != !range1.contains(element33)) throw AssertionError() + if (!(element33 in emptyCharSequence.indices) != !range1.contains(element33)) throw AssertionError() + if (!(element33 !in emptyCharSequence.indices) != range1.contains(element33)) throw AssertionError() +} + +fun testR1xE34() { + // with possible local optimizations + if (4.toFloat() in emptyCharSequence.indices != range1.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in emptyCharSequence.indices != !range1.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in emptyCharSequence.indices) != !range1.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in emptyCharSequence.indices) != range1.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in emptyCharSequence.indices != range1.contains(element34)) throw AssertionError() + if (element34 !in emptyCharSequence.indices != !range1.contains(element34)) throw AssertionError() + if (!(element34 in emptyCharSequence.indices) != !range1.contains(element34)) throw AssertionError() + if (!(element34 !in emptyCharSequence.indices) != range1.contains(element34)) throw AssertionError() +} + +fun testR1xE35() { + // with possible local optimizations + if (4.toDouble() in emptyCharSequence.indices != range1.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in emptyCharSequence.indices != !range1.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in emptyCharSequence.indices) != !range1.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in emptyCharSequence.indices) != range1.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in emptyCharSequence.indices != range1.contains(element35)) throw AssertionError() + if (element35 !in emptyCharSequence.indices != !range1.contains(element35)) throw AssertionError() + if (!(element35 in emptyCharSequence.indices) != !range1.contains(element35)) throw AssertionError() + if (!(element35 !in emptyCharSequence.indices) != range1.contains(element35)) throw AssertionError() +} + + diff --git a/backend.native/tests/external/codegen/box/ranges/contains/generated/charUntil.kt b/backend.native/tests/external/codegen/box/ranges/contains/generated/charUntil.kt new file mode 100644 index 00000000000..380a63eee82 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/generated/charUntil.kt @@ -0,0 +1,159 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_RUNTIME + + + +val range0 = '1' until '3' +val range1 = '3' until '1' + +val element0 = '0' +val element1 = '1' +val element2 = '2' +val element3 = '3' +val element4 = '4' + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if ('0' in '1' until '3' != range0.contains('0')) throw AssertionError() + if ('0' !in '1' until '3' != !range0.contains('0')) throw AssertionError() + if (!('0' in '1' until '3') != !range0.contains('0')) throw AssertionError() + if (!('0' !in '1' until '3') != range0.contains('0')) throw AssertionError() + // no local optimizations + if (element0 in '1' until '3' != range0.contains(element0)) throw AssertionError() + if (element0 !in '1' until '3' != !range0.contains(element0)) throw AssertionError() + if (!(element0 in '1' until '3') != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in '1' until '3') != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if ('1' in '1' until '3' != range0.contains('1')) throw AssertionError() + if ('1' !in '1' until '3' != !range0.contains('1')) throw AssertionError() + if (!('1' in '1' until '3') != !range0.contains('1')) throw AssertionError() + if (!('1' !in '1' until '3') != range0.contains('1')) throw AssertionError() + // no local optimizations + if (element1 in '1' until '3' != range0.contains(element1)) throw AssertionError() + if (element1 !in '1' until '3' != !range0.contains(element1)) throw AssertionError() + if (!(element1 in '1' until '3') != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in '1' until '3') != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if ('2' in '1' until '3' != range0.contains('2')) throw AssertionError() + if ('2' !in '1' until '3' != !range0.contains('2')) throw AssertionError() + if (!('2' in '1' until '3') != !range0.contains('2')) throw AssertionError() + if (!('2' !in '1' until '3') != range0.contains('2')) throw AssertionError() + // no local optimizations + if (element2 in '1' until '3' != range0.contains(element2)) throw AssertionError() + if (element2 !in '1' until '3' != !range0.contains(element2)) throw AssertionError() + if (!(element2 in '1' until '3') != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in '1' until '3') != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if ('3' in '1' until '3' != range0.contains('3')) throw AssertionError() + if ('3' !in '1' until '3' != !range0.contains('3')) throw AssertionError() + if (!('3' in '1' until '3') != !range0.contains('3')) throw AssertionError() + if (!('3' !in '1' until '3') != range0.contains('3')) throw AssertionError() + // no local optimizations + if (element3 in '1' until '3' != range0.contains(element3)) throw AssertionError() + if (element3 !in '1' until '3' != !range0.contains(element3)) throw AssertionError() + if (!(element3 in '1' until '3') != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in '1' until '3') != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if ('4' in '1' until '3' != range0.contains('4')) throw AssertionError() + if ('4' !in '1' until '3' != !range0.contains('4')) throw AssertionError() + if (!('4' in '1' until '3') != !range0.contains('4')) throw AssertionError() + if (!('4' !in '1' until '3') != range0.contains('4')) throw AssertionError() + // no local optimizations + if (element4 in '1' until '3' != range0.contains(element4)) throw AssertionError() + if (element4 !in '1' until '3' != !range0.contains(element4)) throw AssertionError() + if (!(element4 in '1' until '3') != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in '1' until '3') != range0.contains(element4)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if ('0' in '3' until '1' != range1.contains('0')) throw AssertionError() + if ('0' !in '3' until '1' != !range1.contains('0')) throw AssertionError() + if (!('0' in '3' until '1') != !range1.contains('0')) throw AssertionError() + if (!('0' !in '3' until '1') != range1.contains('0')) throw AssertionError() + // no local optimizations + if (element0 in '3' until '1' != range1.contains(element0)) throw AssertionError() + if (element0 !in '3' until '1' != !range1.contains(element0)) throw AssertionError() + if (!(element0 in '3' until '1') != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in '3' until '1') != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if ('1' in '3' until '1' != range1.contains('1')) throw AssertionError() + if ('1' !in '3' until '1' != !range1.contains('1')) throw AssertionError() + if (!('1' in '3' until '1') != !range1.contains('1')) throw AssertionError() + if (!('1' !in '3' until '1') != range1.contains('1')) throw AssertionError() + // no local optimizations + if (element1 in '3' until '1' != range1.contains(element1)) throw AssertionError() + if (element1 !in '3' until '1' != !range1.contains(element1)) throw AssertionError() + if (!(element1 in '3' until '1') != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in '3' until '1') != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if ('2' in '3' until '1' != range1.contains('2')) throw AssertionError() + if ('2' !in '3' until '1' != !range1.contains('2')) throw AssertionError() + if (!('2' in '3' until '1') != !range1.contains('2')) throw AssertionError() + if (!('2' !in '3' until '1') != range1.contains('2')) throw AssertionError() + // no local optimizations + if (element2 in '3' until '1' != range1.contains(element2)) throw AssertionError() + if (element2 !in '3' until '1' != !range1.contains(element2)) throw AssertionError() + if (!(element2 in '3' until '1') != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in '3' until '1') != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if ('3' in '3' until '1' != range1.contains('3')) throw AssertionError() + if ('3' !in '3' until '1' != !range1.contains('3')) throw AssertionError() + if (!('3' in '3' until '1') != !range1.contains('3')) throw AssertionError() + if (!('3' !in '3' until '1') != range1.contains('3')) throw AssertionError() + // no local optimizations + if (element3 in '3' until '1' != range1.contains(element3)) throw AssertionError() + if (element3 !in '3' until '1' != !range1.contains(element3)) throw AssertionError() + if (!(element3 in '3' until '1') != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in '3' until '1') != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if ('4' in '3' until '1' != range1.contains('4')) throw AssertionError() + if ('4' !in '3' until '1' != !range1.contains('4')) throw AssertionError() + if (!('4' in '3' until '1') != !range1.contains('4')) throw AssertionError() + if (!('4' !in '3' until '1') != range1.contains('4')) throw AssertionError() + // no local optimizations + if (element4 in '3' until '1' != range1.contains(element4)) throw AssertionError() + if (element4 !in '3' until '1' != !range1.contains(element4)) throw AssertionError() + if (!(element4 in '3' until '1') != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in '3' until '1') != range1.contains(element4)) throw AssertionError() +} + + diff --git a/backend.native/tests/external/codegen/box/ranges/contains/generated/collectionIndices.kt b/backend.native/tests/external/codegen/box/ranges/contains/generated/collectionIndices.kt new file mode 100644 index 00000000000..952f5e7b4e9 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/generated/collectionIndices.kt @@ -0,0 +1,1059 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_RUNTIME + +val collection = listOf(1, 2, 3) +val emptyCollection = listOf() + +val range0 = collection.indices +val range1 = emptyCollection.indices + +val element0 = (-1).toByte() +val element1 = (-1).toShort() +val element2 = (-1) +val element3 = (-1).toLong() +val element4 = (-1).toFloat() +val element5 = (-1).toDouble() +val element6 = 0.toByte() +val element7 = 0.toShort() +val element8 = 0 +val element9 = 0.toLong() +val element10 = 0.toFloat() +val element11 = 0.toDouble() +val element12 = 1.toByte() +val element13 = 1.toShort() +val element14 = 1 +val element15 = 1.toLong() +val element16 = 1.toFloat() +val element17 = 1.toDouble() +val element18 = 2.toByte() +val element19 = 2.toShort() +val element20 = 2 +val element21 = 2.toLong() +val element22 = 2.toFloat() +val element23 = 2.toDouble() +val element24 = 3.toByte() +val element25 = 3.toShort() +val element26 = 3 +val element27 = 3.toLong() +val element28 = 3.toFloat() +val element29 = 3.toDouble() +val element30 = 4.toByte() +val element31 = 4.toShort() +val element32 = 4 +val element33 = 4.toLong() +val element34 = 4.toFloat() +val element35 = 4.toDouble() + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR0xE5() + testR0xE6() + testR0xE7() + testR0xE8() + testR0xE9() + testR0xE10() + testR0xE11() + testR0xE12() + testR0xE13() + testR0xE14() + testR0xE15() + testR0xE16() + testR0xE17() + testR0xE18() + testR0xE19() + testR0xE20() + testR0xE21() + testR0xE22() + testR0xE23() + testR0xE24() + testR0xE25() + testR0xE26() + testR0xE27() + testR0xE28() + testR0xE29() + testR0xE30() + testR0xE31() + testR0xE32() + testR0xE33() + testR0xE34() + testR0xE35() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + testR1xE5() + testR1xE6() + testR1xE7() + testR1xE8() + testR1xE9() + testR1xE10() + testR1xE11() + testR1xE12() + testR1xE13() + testR1xE14() + testR1xE15() + testR1xE16() + testR1xE17() + testR1xE18() + testR1xE19() + testR1xE20() + testR1xE21() + testR1xE22() + testR1xE23() + testR1xE24() + testR1xE25() + testR1xE26() + testR1xE27() + testR1xE28() + testR1xE29() + testR1xE30() + testR1xE31() + testR1xE32() + testR1xE33() + testR1xE34() + testR1xE35() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if ((-1).toByte() in collection.indices != range0.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in collection.indices != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in collection.indices) != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in collection.indices) != range0.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in collection.indices != range0.contains(element0)) throw AssertionError() + if (element0 !in collection.indices != !range0.contains(element0)) throw AssertionError() + if (!(element0 in collection.indices) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in collection.indices) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if ((-1).toShort() in collection.indices != range0.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in collection.indices != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in collection.indices) != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in collection.indices) != range0.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in collection.indices != range0.contains(element1)) throw AssertionError() + if (element1 !in collection.indices != !range0.contains(element1)) throw AssertionError() + if (!(element1 in collection.indices) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in collection.indices) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if ((-1) in collection.indices != range0.contains((-1))) throw AssertionError() + if ((-1) !in collection.indices != !range0.contains((-1))) throw AssertionError() + if (!((-1) in collection.indices) != !range0.contains((-1))) throw AssertionError() + if (!((-1) !in collection.indices) != range0.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in collection.indices != range0.contains(element2)) throw AssertionError() + if (element2 !in collection.indices != !range0.contains(element2)) throw AssertionError() + if (!(element2 in collection.indices) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in collection.indices) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if ((-1).toLong() in collection.indices != range0.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in collection.indices != !range0.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in collection.indices) != !range0.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in collection.indices) != range0.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in collection.indices != range0.contains(element3)) throw AssertionError() + if (element3 !in collection.indices != !range0.contains(element3)) throw AssertionError() + if (!(element3 in collection.indices) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in collection.indices) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if ((-1).toFloat() in collection.indices != range0.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in collection.indices != !range0.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in collection.indices) != !range0.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in collection.indices) != range0.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in collection.indices != range0.contains(element4)) throw AssertionError() + if (element4 !in collection.indices != !range0.contains(element4)) throw AssertionError() + if (!(element4 in collection.indices) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in collection.indices) != range0.contains(element4)) throw AssertionError() +} + +fun testR0xE5() { + // with possible local optimizations + if ((-1).toDouble() in collection.indices != range0.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in collection.indices != !range0.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in collection.indices) != !range0.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in collection.indices) != range0.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in collection.indices != range0.contains(element5)) throw AssertionError() + if (element5 !in collection.indices != !range0.contains(element5)) throw AssertionError() + if (!(element5 in collection.indices) != !range0.contains(element5)) throw AssertionError() + if (!(element5 !in collection.indices) != range0.contains(element5)) throw AssertionError() +} + +fun testR0xE6() { + // with possible local optimizations + if (0.toByte() in collection.indices != range0.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in collection.indices != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in collection.indices) != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in collection.indices) != range0.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in collection.indices != range0.contains(element6)) throw AssertionError() + if (element6 !in collection.indices != !range0.contains(element6)) throw AssertionError() + if (!(element6 in collection.indices) != !range0.contains(element6)) throw AssertionError() + if (!(element6 !in collection.indices) != range0.contains(element6)) throw AssertionError() +} + +fun testR0xE7() { + // with possible local optimizations + if (0.toShort() in collection.indices != range0.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in collection.indices != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in collection.indices) != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in collection.indices) != range0.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in collection.indices != range0.contains(element7)) throw AssertionError() + if (element7 !in collection.indices != !range0.contains(element7)) throw AssertionError() + if (!(element7 in collection.indices) != !range0.contains(element7)) throw AssertionError() + if (!(element7 !in collection.indices) != range0.contains(element7)) throw AssertionError() +} + +fun testR0xE8() { + // with possible local optimizations + if (0 in collection.indices != range0.contains(0)) throw AssertionError() + if (0 !in collection.indices != !range0.contains(0)) throw AssertionError() + if (!(0 in collection.indices) != !range0.contains(0)) throw AssertionError() + if (!(0 !in collection.indices) != range0.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in collection.indices != range0.contains(element8)) throw AssertionError() + if (element8 !in collection.indices != !range0.contains(element8)) throw AssertionError() + if (!(element8 in collection.indices) != !range0.contains(element8)) throw AssertionError() + if (!(element8 !in collection.indices) != range0.contains(element8)) throw AssertionError() +} + +fun testR0xE9() { + // with possible local optimizations + if (0.toLong() in collection.indices != range0.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in collection.indices != !range0.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in collection.indices) != !range0.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in collection.indices) != range0.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in collection.indices != range0.contains(element9)) throw AssertionError() + if (element9 !in collection.indices != !range0.contains(element9)) throw AssertionError() + if (!(element9 in collection.indices) != !range0.contains(element9)) throw AssertionError() + if (!(element9 !in collection.indices) != range0.contains(element9)) throw AssertionError() +} + +fun testR0xE10() { + // with possible local optimizations + if (0.toFloat() in collection.indices != range0.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in collection.indices != !range0.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in collection.indices) != !range0.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in collection.indices) != range0.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in collection.indices != range0.contains(element10)) throw AssertionError() + if (element10 !in collection.indices != !range0.contains(element10)) throw AssertionError() + if (!(element10 in collection.indices) != !range0.contains(element10)) throw AssertionError() + if (!(element10 !in collection.indices) != range0.contains(element10)) throw AssertionError() +} + +fun testR0xE11() { + // with possible local optimizations + if (0.toDouble() in collection.indices != range0.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in collection.indices != !range0.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in collection.indices) != !range0.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in collection.indices) != range0.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in collection.indices != range0.contains(element11)) throw AssertionError() + if (element11 !in collection.indices != !range0.contains(element11)) throw AssertionError() + if (!(element11 in collection.indices) != !range0.contains(element11)) throw AssertionError() + if (!(element11 !in collection.indices) != range0.contains(element11)) throw AssertionError() +} + +fun testR0xE12() { + // with possible local optimizations + if (1.toByte() in collection.indices != range0.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in collection.indices != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in collection.indices) != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in collection.indices) != range0.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in collection.indices != range0.contains(element12)) throw AssertionError() + if (element12 !in collection.indices != !range0.contains(element12)) throw AssertionError() + if (!(element12 in collection.indices) != !range0.contains(element12)) throw AssertionError() + if (!(element12 !in collection.indices) != range0.contains(element12)) throw AssertionError() +} + +fun testR0xE13() { + // with possible local optimizations + if (1.toShort() in collection.indices != range0.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in collection.indices != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in collection.indices) != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in collection.indices) != range0.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in collection.indices != range0.contains(element13)) throw AssertionError() + if (element13 !in collection.indices != !range0.contains(element13)) throw AssertionError() + if (!(element13 in collection.indices) != !range0.contains(element13)) throw AssertionError() + if (!(element13 !in collection.indices) != range0.contains(element13)) throw AssertionError() +} + +fun testR0xE14() { + // with possible local optimizations + if (1 in collection.indices != range0.contains(1)) throw AssertionError() + if (1 !in collection.indices != !range0.contains(1)) throw AssertionError() + if (!(1 in collection.indices) != !range0.contains(1)) throw AssertionError() + if (!(1 !in collection.indices) != range0.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in collection.indices != range0.contains(element14)) throw AssertionError() + if (element14 !in collection.indices != !range0.contains(element14)) throw AssertionError() + if (!(element14 in collection.indices) != !range0.contains(element14)) throw AssertionError() + if (!(element14 !in collection.indices) != range0.contains(element14)) throw AssertionError() +} + +fun testR0xE15() { + // with possible local optimizations + if (1.toLong() in collection.indices != range0.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in collection.indices != !range0.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in collection.indices) != !range0.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in collection.indices) != range0.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in collection.indices != range0.contains(element15)) throw AssertionError() + if (element15 !in collection.indices != !range0.contains(element15)) throw AssertionError() + if (!(element15 in collection.indices) != !range0.contains(element15)) throw AssertionError() + if (!(element15 !in collection.indices) != range0.contains(element15)) throw AssertionError() +} + +fun testR0xE16() { + // with possible local optimizations + if (1.toFloat() in collection.indices != range0.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in collection.indices != !range0.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in collection.indices) != !range0.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in collection.indices) != range0.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in collection.indices != range0.contains(element16)) throw AssertionError() + if (element16 !in collection.indices != !range0.contains(element16)) throw AssertionError() + if (!(element16 in collection.indices) != !range0.contains(element16)) throw AssertionError() + if (!(element16 !in collection.indices) != range0.contains(element16)) throw AssertionError() +} + +fun testR0xE17() { + // with possible local optimizations + if (1.toDouble() in collection.indices != range0.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in collection.indices != !range0.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in collection.indices) != !range0.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in collection.indices) != range0.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in collection.indices != range0.contains(element17)) throw AssertionError() + if (element17 !in collection.indices != !range0.contains(element17)) throw AssertionError() + if (!(element17 in collection.indices) != !range0.contains(element17)) throw AssertionError() + if (!(element17 !in collection.indices) != range0.contains(element17)) throw AssertionError() +} + +fun testR0xE18() { + // with possible local optimizations + if (2.toByte() in collection.indices != range0.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in collection.indices != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in collection.indices) != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in collection.indices) != range0.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in collection.indices != range0.contains(element18)) throw AssertionError() + if (element18 !in collection.indices != !range0.contains(element18)) throw AssertionError() + if (!(element18 in collection.indices) != !range0.contains(element18)) throw AssertionError() + if (!(element18 !in collection.indices) != range0.contains(element18)) throw AssertionError() +} + +fun testR0xE19() { + // with possible local optimizations + if (2.toShort() in collection.indices != range0.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in collection.indices != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in collection.indices) != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in collection.indices) != range0.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in collection.indices != range0.contains(element19)) throw AssertionError() + if (element19 !in collection.indices != !range0.contains(element19)) throw AssertionError() + if (!(element19 in collection.indices) != !range0.contains(element19)) throw AssertionError() + if (!(element19 !in collection.indices) != range0.contains(element19)) throw AssertionError() +} + +fun testR0xE20() { + // with possible local optimizations + if (2 in collection.indices != range0.contains(2)) throw AssertionError() + if (2 !in collection.indices != !range0.contains(2)) throw AssertionError() + if (!(2 in collection.indices) != !range0.contains(2)) throw AssertionError() + if (!(2 !in collection.indices) != range0.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in collection.indices != range0.contains(element20)) throw AssertionError() + if (element20 !in collection.indices != !range0.contains(element20)) throw AssertionError() + if (!(element20 in collection.indices) != !range0.contains(element20)) throw AssertionError() + if (!(element20 !in collection.indices) != range0.contains(element20)) throw AssertionError() +} + +fun testR0xE21() { + // with possible local optimizations + if (2.toLong() in collection.indices != range0.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in collection.indices != !range0.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in collection.indices) != !range0.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in collection.indices) != range0.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in collection.indices != range0.contains(element21)) throw AssertionError() + if (element21 !in collection.indices != !range0.contains(element21)) throw AssertionError() + if (!(element21 in collection.indices) != !range0.contains(element21)) throw AssertionError() + if (!(element21 !in collection.indices) != range0.contains(element21)) throw AssertionError() +} + +fun testR0xE22() { + // with possible local optimizations + if (2.toFloat() in collection.indices != range0.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in collection.indices != !range0.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in collection.indices) != !range0.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in collection.indices) != range0.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in collection.indices != range0.contains(element22)) throw AssertionError() + if (element22 !in collection.indices != !range0.contains(element22)) throw AssertionError() + if (!(element22 in collection.indices) != !range0.contains(element22)) throw AssertionError() + if (!(element22 !in collection.indices) != range0.contains(element22)) throw AssertionError() +} + +fun testR0xE23() { + // with possible local optimizations + if (2.toDouble() in collection.indices != range0.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in collection.indices != !range0.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in collection.indices) != !range0.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in collection.indices) != range0.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in collection.indices != range0.contains(element23)) throw AssertionError() + if (element23 !in collection.indices != !range0.contains(element23)) throw AssertionError() + if (!(element23 in collection.indices) != !range0.contains(element23)) throw AssertionError() + if (!(element23 !in collection.indices) != range0.contains(element23)) throw AssertionError() +} + +fun testR0xE24() { + // with possible local optimizations + if (3.toByte() in collection.indices != range0.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in collection.indices != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in collection.indices) != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in collection.indices) != range0.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in collection.indices != range0.contains(element24)) throw AssertionError() + if (element24 !in collection.indices != !range0.contains(element24)) throw AssertionError() + if (!(element24 in collection.indices) != !range0.contains(element24)) throw AssertionError() + if (!(element24 !in collection.indices) != range0.contains(element24)) throw AssertionError() +} + +fun testR0xE25() { + // with possible local optimizations + if (3.toShort() in collection.indices != range0.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in collection.indices != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in collection.indices) != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in collection.indices) != range0.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in collection.indices != range0.contains(element25)) throw AssertionError() + if (element25 !in collection.indices != !range0.contains(element25)) throw AssertionError() + if (!(element25 in collection.indices) != !range0.contains(element25)) throw AssertionError() + if (!(element25 !in collection.indices) != range0.contains(element25)) throw AssertionError() +} + +fun testR0xE26() { + // with possible local optimizations + if (3 in collection.indices != range0.contains(3)) throw AssertionError() + if (3 !in collection.indices != !range0.contains(3)) throw AssertionError() + if (!(3 in collection.indices) != !range0.contains(3)) throw AssertionError() + if (!(3 !in collection.indices) != range0.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in collection.indices != range0.contains(element26)) throw AssertionError() + if (element26 !in collection.indices != !range0.contains(element26)) throw AssertionError() + if (!(element26 in collection.indices) != !range0.contains(element26)) throw AssertionError() + if (!(element26 !in collection.indices) != range0.contains(element26)) throw AssertionError() +} + +fun testR0xE27() { + // with possible local optimizations + if (3.toLong() in collection.indices != range0.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in collection.indices != !range0.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in collection.indices) != !range0.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in collection.indices) != range0.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in collection.indices != range0.contains(element27)) throw AssertionError() + if (element27 !in collection.indices != !range0.contains(element27)) throw AssertionError() + if (!(element27 in collection.indices) != !range0.contains(element27)) throw AssertionError() + if (!(element27 !in collection.indices) != range0.contains(element27)) throw AssertionError() +} + +fun testR0xE28() { + // with possible local optimizations + if (3.toFloat() in collection.indices != range0.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in collection.indices != !range0.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in collection.indices) != !range0.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in collection.indices) != range0.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in collection.indices != range0.contains(element28)) throw AssertionError() + if (element28 !in collection.indices != !range0.contains(element28)) throw AssertionError() + if (!(element28 in collection.indices) != !range0.contains(element28)) throw AssertionError() + if (!(element28 !in collection.indices) != range0.contains(element28)) throw AssertionError() +} + +fun testR0xE29() { + // with possible local optimizations + if (3.toDouble() in collection.indices != range0.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in collection.indices != !range0.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in collection.indices) != !range0.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in collection.indices) != range0.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in collection.indices != range0.contains(element29)) throw AssertionError() + if (element29 !in collection.indices != !range0.contains(element29)) throw AssertionError() + if (!(element29 in collection.indices) != !range0.contains(element29)) throw AssertionError() + if (!(element29 !in collection.indices) != range0.contains(element29)) throw AssertionError() +} + +fun testR0xE30() { + // with possible local optimizations + if (4.toByte() in collection.indices != range0.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in collection.indices != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in collection.indices) != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in collection.indices) != range0.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in collection.indices != range0.contains(element30)) throw AssertionError() + if (element30 !in collection.indices != !range0.contains(element30)) throw AssertionError() + if (!(element30 in collection.indices) != !range0.contains(element30)) throw AssertionError() + if (!(element30 !in collection.indices) != range0.contains(element30)) throw AssertionError() +} + +fun testR0xE31() { + // with possible local optimizations + if (4.toShort() in collection.indices != range0.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in collection.indices != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in collection.indices) != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in collection.indices) != range0.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in collection.indices != range0.contains(element31)) throw AssertionError() + if (element31 !in collection.indices != !range0.contains(element31)) throw AssertionError() + if (!(element31 in collection.indices) != !range0.contains(element31)) throw AssertionError() + if (!(element31 !in collection.indices) != range0.contains(element31)) throw AssertionError() +} + +fun testR0xE32() { + // with possible local optimizations + if (4 in collection.indices != range0.contains(4)) throw AssertionError() + if (4 !in collection.indices != !range0.contains(4)) throw AssertionError() + if (!(4 in collection.indices) != !range0.contains(4)) throw AssertionError() + if (!(4 !in collection.indices) != range0.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in collection.indices != range0.contains(element32)) throw AssertionError() + if (element32 !in collection.indices != !range0.contains(element32)) throw AssertionError() + if (!(element32 in collection.indices) != !range0.contains(element32)) throw AssertionError() + if (!(element32 !in collection.indices) != range0.contains(element32)) throw AssertionError() +} + +fun testR0xE33() { + // with possible local optimizations + if (4.toLong() in collection.indices != range0.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in collection.indices != !range0.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in collection.indices) != !range0.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in collection.indices) != range0.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in collection.indices != range0.contains(element33)) throw AssertionError() + if (element33 !in collection.indices != !range0.contains(element33)) throw AssertionError() + if (!(element33 in collection.indices) != !range0.contains(element33)) throw AssertionError() + if (!(element33 !in collection.indices) != range0.contains(element33)) throw AssertionError() +} + +fun testR0xE34() { + // with possible local optimizations + if (4.toFloat() in collection.indices != range0.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in collection.indices != !range0.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in collection.indices) != !range0.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in collection.indices) != range0.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in collection.indices != range0.contains(element34)) throw AssertionError() + if (element34 !in collection.indices != !range0.contains(element34)) throw AssertionError() + if (!(element34 in collection.indices) != !range0.contains(element34)) throw AssertionError() + if (!(element34 !in collection.indices) != range0.contains(element34)) throw AssertionError() +} + +fun testR0xE35() { + // with possible local optimizations + if (4.toDouble() in collection.indices != range0.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in collection.indices != !range0.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in collection.indices) != !range0.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in collection.indices) != range0.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in collection.indices != range0.contains(element35)) throw AssertionError() + if (element35 !in collection.indices != !range0.contains(element35)) throw AssertionError() + if (!(element35 in collection.indices) != !range0.contains(element35)) throw AssertionError() + if (!(element35 !in collection.indices) != range0.contains(element35)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if ((-1).toByte() in emptyCollection.indices != range1.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in emptyCollection.indices != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in emptyCollection.indices) != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in emptyCollection.indices) != range1.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in emptyCollection.indices != range1.contains(element0)) throw AssertionError() + if (element0 !in emptyCollection.indices != !range1.contains(element0)) throw AssertionError() + if (!(element0 in emptyCollection.indices) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in emptyCollection.indices) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if ((-1).toShort() in emptyCollection.indices != range1.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in emptyCollection.indices != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in emptyCollection.indices) != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in emptyCollection.indices) != range1.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in emptyCollection.indices != range1.contains(element1)) throw AssertionError() + if (element1 !in emptyCollection.indices != !range1.contains(element1)) throw AssertionError() + if (!(element1 in emptyCollection.indices) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in emptyCollection.indices) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if ((-1) in emptyCollection.indices != range1.contains((-1))) throw AssertionError() + if ((-1) !in emptyCollection.indices != !range1.contains((-1))) throw AssertionError() + if (!((-1) in emptyCollection.indices) != !range1.contains((-1))) throw AssertionError() + if (!((-1) !in emptyCollection.indices) != range1.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in emptyCollection.indices != range1.contains(element2)) throw AssertionError() + if (element2 !in emptyCollection.indices != !range1.contains(element2)) throw AssertionError() + if (!(element2 in emptyCollection.indices) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in emptyCollection.indices) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if ((-1).toLong() in emptyCollection.indices != range1.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in emptyCollection.indices != !range1.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in emptyCollection.indices) != !range1.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in emptyCollection.indices) != range1.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in emptyCollection.indices != range1.contains(element3)) throw AssertionError() + if (element3 !in emptyCollection.indices != !range1.contains(element3)) throw AssertionError() + if (!(element3 in emptyCollection.indices) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in emptyCollection.indices) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if ((-1).toFloat() in emptyCollection.indices != range1.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in emptyCollection.indices != !range1.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in emptyCollection.indices) != !range1.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in emptyCollection.indices) != range1.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in emptyCollection.indices != range1.contains(element4)) throw AssertionError() + if (element4 !in emptyCollection.indices != !range1.contains(element4)) throw AssertionError() + if (!(element4 in emptyCollection.indices) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in emptyCollection.indices) != range1.contains(element4)) throw AssertionError() +} + +fun testR1xE5() { + // with possible local optimizations + if ((-1).toDouble() in emptyCollection.indices != range1.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in emptyCollection.indices != !range1.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in emptyCollection.indices) != !range1.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in emptyCollection.indices) != range1.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in emptyCollection.indices != range1.contains(element5)) throw AssertionError() + if (element5 !in emptyCollection.indices != !range1.contains(element5)) throw AssertionError() + if (!(element5 in emptyCollection.indices) != !range1.contains(element5)) throw AssertionError() + if (!(element5 !in emptyCollection.indices) != range1.contains(element5)) throw AssertionError() +} + +fun testR1xE6() { + // with possible local optimizations + if (0.toByte() in emptyCollection.indices != range1.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in emptyCollection.indices != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in emptyCollection.indices) != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in emptyCollection.indices) != range1.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in emptyCollection.indices != range1.contains(element6)) throw AssertionError() + if (element6 !in emptyCollection.indices != !range1.contains(element6)) throw AssertionError() + if (!(element6 in emptyCollection.indices) != !range1.contains(element6)) throw AssertionError() + if (!(element6 !in emptyCollection.indices) != range1.contains(element6)) throw AssertionError() +} + +fun testR1xE7() { + // with possible local optimizations + if (0.toShort() in emptyCollection.indices != range1.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in emptyCollection.indices != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in emptyCollection.indices) != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in emptyCollection.indices) != range1.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in emptyCollection.indices != range1.contains(element7)) throw AssertionError() + if (element7 !in emptyCollection.indices != !range1.contains(element7)) throw AssertionError() + if (!(element7 in emptyCollection.indices) != !range1.contains(element7)) throw AssertionError() + if (!(element7 !in emptyCollection.indices) != range1.contains(element7)) throw AssertionError() +} + +fun testR1xE8() { + // with possible local optimizations + if (0 in emptyCollection.indices != range1.contains(0)) throw AssertionError() + if (0 !in emptyCollection.indices != !range1.contains(0)) throw AssertionError() + if (!(0 in emptyCollection.indices) != !range1.contains(0)) throw AssertionError() + if (!(0 !in emptyCollection.indices) != range1.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in emptyCollection.indices != range1.contains(element8)) throw AssertionError() + if (element8 !in emptyCollection.indices != !range1.contains(element8)) throw AssertionError() + if (!(element8 in emptyCollection.indices) != !range1.contains(element8)) throw AssertionError() + if (!(element8 !in emptyCollection.indices) != range1.contains(element8)) throw AssertionError() +} + +fun testR1xE9() { + // with possible local optimizations + if (0.toLong() in emptyCollection.indices != range1.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in emptyCollection.indices != !range1.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in emptyCollection.indices) != !range1.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in emptyCollection.indices) != range1.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in emptyCollection.indices != range1.contains(element9)) throw AssertionError() + if (element9 !in emptyCollection.indices != !range1.contains(element9)) throw AssertionError() + if (!(element9 in emptyCollection.indices) != !range1.contains(element9)) throw AssertionError() + if (!(element9 !in emptyCollection.indices) != range1.contains(element9)) throw AssertionError() +} + +fun testR1xE10() { + // with possible local optimizations + if (0.toFloat() in emptyCollection.indices != range1.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in emptyCollection.indices != !range1.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in emptyCollection.indices) != !range1.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in emptyCollection.indices) != range1.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in emptyCollection.indices != range1.contains(element10)) throw AssertionError() + if (element10 !in emptyCollection.indices != !range1.contains(element10)) throw AssertionError() + if (!(element10 in emptyCollection.indices) != !range1.contains(element10)) throw AssertionError() + if (!(element10 !in emptyCollection.indices) != range1.contains(element10)) throw AssertionError() +} + +fun testR1xE11() { + // with possible local optimizations + if (0.toDouble() in emptyCollection.indices != range1.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in emptyCollection.indices != !range1.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in emptyCollection.indices) != !range1.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in emptyCollection.indices) != range1.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in emptyCollection.indices != range1.contains(element11)) throw AssertionError() + if (element11 !in emptyCollection.indices != !range1.contains(element11)) throw AssertionError() + if (!(element11 in emptyCollection.indices) != !range1.contains(element11)) throw AssertionError() + if (!(element11 !in emptyCollection.indices) != range1.contains(element11)) throw AssertionError() +} + +fun testR1xE12() { + // with possible local optimizations + if (1.toByte() in emptyCollection.indices != range1.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in emptyCollection.indices != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in emptyCollection.indices) != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in emptyCollection.indices) != range1.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in emptyCollection.indices != range1.contains(element12)) throw AssertionError() + if (element12 !in emptyCollection.indices != !range1.contains(element12)) throw AssertionError() + if (!(element12 in emptyCollection.indices) != !range1.contains(element12)) throw AssertionError() + if (!(element12 !in emptyCollection.indices) != range1.contains(element12)) throw AssertionError() +} + +fun testR1xE13() { + // with possible local optimizations + if (1.toShort() in emptyCollection.indices != range1.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in emptyCollection.indices != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in emptyCollection.indices) != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in emptyCollection.indices) != range1.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in emptyCollection.indices != range1.contains(element13)) throw AssertionError() + if (element13 !in emptyCollection.indices != !range1.contains(element13)) throw AssertionError() + if (!(element13 in emptyCollection.indices) != !range1.contains(element13)) throw AssertionError() + if (!(element13 !in emptyCollection.indices) != range1.contains(element13)) throw AssertionError() +} + +fun testR1xE14() { + // with possible local optimizations + if (1 in emptyCollection.indices != range1.contains(1)) throw AssertionError() + if (1 !in emptyCollection.indices != !range1.contains(1)) throw AssertionError() + if (!(1 in emptyCollection.indices) != !range1.contains(1)) throw AssertionError() + if (!(1 !in emptyCollection.indices) != range1.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in emptyCollection.indices != range1.contains(element14)) throw AssertionError() + if (element14 !in emptyCollection.indices != !range1.contains(element14)) throw AssertionError() + if (!(element14 in emptyCollection.indices) != !range1.contains(element14)) throw AssertionError() + if (!(element14 !in emptyCollection.indices) != range1.contains(element14)) throw AssertionError() +} + +fun testR1xE15() { + // with possible local optimizations + if (1.toLong() in emptyCollection.indices != range1.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in emptyCollection.indices != !range1.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in emptyCollection.indices) != !range1.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in emptyCollection.indices) != range1.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in emptyCollection.indices != range1.contains(element15)) throw AssertionError() + if (element15 !in emptyCollection.indices != !range1.contains(element15)) throw AssertionError() + if (!(element15 in emptyCollection.indices) != !range1.contains(element15)) throw AssertionError() + if (!(element15 !in emptyCollection.indices) != range1.contains(element15)) throw AssertionError() +} + +fun testR1xE16() { + // with possible local optimizations + if (1.toFloat() in emptyCollection.indices != range1.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in emptyCollection.indices != !range1.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in emptyCollection.indices) != !range1.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in emptyCollection.indices) != range1.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in emptyCollection.indices != range1.contains(element16)) throw AssertionError() + if (element16 !in emptyCollection.indices != !range1.contains(element16)) throw AssertionError() + if (!(element16 in emptyCollection.indices) != !range1.contains(element16)) throw AssertionError() + if (!(element16 !in emptyCollection.indices) != range1.contains(element16)) throw AssertionError() +} + +fun testR1xE17() { + // with possible local optimizations + if (1.toDouble() in emptyCollection.indices != range1.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in emptyCollection.indices != !range1.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in emptyCollection.indices) != !range1.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in emptyCollection.indices) != range1.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in emptyCollection.indices != range1.contains(element17)) throw AssertionError() + if (element17 !in emptyCollection.indices != !range1.contains(element17)) throw AssertionError() + if (!(element17 in emptyCollection.indices) != !range1.contains(element17)) throw AssertionError() + if (!(element17 !in emptyCollection.indices) != range1.contains(element17)) throw AssertionError() +} + +fun testR1xE18() { + // with possible local optimizations + if (2.toByte() in emptyCollection.indices != range1.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in emptyCollection.indices != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in emptyCollection.indices) != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in emptyCollection.indices) != range1.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in emptyCollection.indices != range1.contains(element18)) throw AssertionError() + if (element18 !in emptyCollection.indices != !range1.contains(element18)) throw AssertionError() + if (!(element18 in emptyCollection.indices) != !range1.contains(element18)) throw AssertionError() + if (!(element18 !in emptyCollection.indices) != range1.contains(element18)) throw AssertionError() +} + +fun testR1xE19() { + // with possible local optimizations + if (2.toShort() in emptyCollection.indices != range1.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in emptyCollection.indices != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in emptyCollection.indices) != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in emptyCollection.indices) != range1.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in emptyCollection.indices != range1.contains(element19)) throw AssertionError() + if (element19 !in emptyCollection.indices != !range1.contains(element19)) throw AssertionError() + if (!(element19 in emptyCollection.indices) != !range1.contains(element19)) throw AssertionError() + if (!(element19 !in emptyCollection.indices) != range1.contains(element19)) throw AssertionError() +} + +fun testR1xE20() { + // with possible local optimizations + if (2 in emptyCollection.indices != range1.contains(2)) throw AssertionError() + if (2 !in emptyCollection.indices != !range1.contains(2)) throw AssertionError() + if (!(2 in emptyCollection.indices) != !range1.contains(2)) throw AssertionError() + if (!(2 !in emptyCollection.indices) != range1.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in emptyCollection.indices != range1.contains(element20)) throw AssertionError() + if (element20 !in emptyCollection.indices != !range1.contains(element20)) throw AssertionError() + if (!(element20 in emptyCollection.indices) != !range1.contains(element20)) throw AssertionError() + if (!(element20 !in emptyCollection.indices) != range1.contains(element20)) throw AssertionError() +} + +fun testR1xE21() { + // with possible local optimizations + if (2.toLong() in emptyCollection.indices != range1.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in emptyCollection.indices != !range1.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in emptyCollection.indices) != !range1.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in emptyCollection.indices) != range1.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in emptyCollection.indices != range1.contains(element21)) throw AssertionError() + if (element21 !in emptyCollection.indices != !range1.contains(element21)) throw AssertionError() + if (!(element21 in emptyCollection.indices) != !range1.contains(element21)) throw AssertionError() + if (!(element21 !in emptyCollection.indices) != range1.contains(element21)) throw AssertionError() +} + +fun testR1xE22() { + // with possible local optimizations + if (2.toFloat() in emptyCollection.indices != range1.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in emptyCollection.indices != !range1.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in emptyCollection.indices) != !range1.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in emptyCollection.indices) != range1.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in emptyCollection.indices != range1.contains(element22)) throw AssertionError() + if (element22 !in emptyCollection.indices != !range1.contains(element22)) throw AssertionError() + if (!(element22 in emptyCollection.indices) != !range1.contains(element22)) throw AssertionError() + if (!(element22 !in emptyCollection.indices) != range1.contains(element22)) throw AssertionError() +} + +fun testR1xE23() { + // with possible local optimizations + if (2.toDouble() in emptyCollection.indices != range1.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in emptyCollection.indices != !range1.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in emptyCollection.indices) != !range1.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in emptyCollection.indices) != range1.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in emptyCollection.indices != range1.contains(element23)) throw AssertionError() + if (element23 !in emptyCollection.indices != !range1.contains(element23)) throw AssertionError() + if (!(element23 in emptyCollection.indices) != !range1.contains(element23)) throw AssertionError() + if (!(element23 !in emptyCollection.indices) != range1.contains(element23)) throw AssertionError() +} + +fun testR1xE24() { + // with possible local optimizations + if (3.toByte() in emptyCollection.indices != range1.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in emptyCollection.indices != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in emptyCollection.indices) != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in emptyCollection.indices) != range1.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in emptyCollection.indices != range1.contains(element24)) throw AssertionError() + if (element24 !in emptyCollection.indices != !range1.contains(element24)) throw AssertionError() + if (!(element24 in emptyCollection.indices) != !range1.contains(element24)) throw AssertionError() + if (!(element24 !in emptyCollection.indices) != range1.contains(element24)) throw AssertionError() +} + +fun testR1xE25() { + // with possible local optimizations + if (3.toShort() in emptyCollection.indices != range1.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in emptyCollection.indices != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in emptyCollection.indices) != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in emptyCollection.indices) != range1.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in emptyCollection.indices != range1.contains(element25)) throw AssertionError() + if (element25 !in emptyCollection.indices != !range1.contains(element25)) throw AssertionError() + if (!(element25 in emptyCollection.indices) != !range1.contains(element25)) throw AssertionError() + if (!(element25 !in emptyCollection.indices) != range1.contains(element25)) throw AssertionError() +} + +fun testR1xE26() { + // with possible local optimizations + if (3 in emptyCollection.indices != range1.contains(3)) throw AssertionError() + if (3 !in emptyCollection.indices != !range1.contains(3)) throw AssertionError() + if (!(3 in emptyCollection.indices) != !range1.contains(3)) throw AssertionError() + if (!(3 !in emptyCollection.indices) != range1.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in emptyCollection.indices != range1.contains(element26)) throw AssertionError() + if (element26 !in emptyCollection.indices != !range1.contains(element26)) throw AssertionError() + if (!(element26 in emptyCollection.indices) != !range1.contains(element26)) throw AssertionError() + if (!(element26 !in emptyCollection.indices) != range1.contains(element26)) throw AssertionError() +} + +fun testR1xE27() { + // with possible local optimizations + if (3.toLong() in emptyCollection.indices != range1.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in emptyCollection.indices != !range1.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in emptyCollection.indices) != !range1.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in emptyCollection.indices) != range1.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in emptyCollection.indices != range1.contains(element27)) throw AssertionError() + if (element27 !in emptyCollection.indices != !range1.contains(element27)) throw AssertionError() + if (!(element27 in emptyCollection.indices) != !range1.contains(element27)) throw AssertionError() + if (!(element27 !in emptyCollection.indices) != range1.contains(element27)) throw AssertionError() +} + +fun testR1xE28() { + // with possible local optimizations + if (3.toFloat() in emptyCollection.indices != range1.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in emptyCollection.indices != !range1.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in emptyCollection.indices) != !range1.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in emptyCollection.indices) != range1.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in emptyCollection.indices != range1.contains(element28)) throw AssertionError() + if (element28 !in emptyCollection.indices != !range1.contains(element28)) throw AssertionError() + if (!(element28 in emptyCollection.indices) != !range1.contains(element28)) throw AssertionError() + if (!(element28 !in emptyCollection.indices) != range1.contains(element28)) throw AssertionError() +} + +fun testR1xE29() { + // with possible local optimizations + if (3.toDouble() in emptyCollection.indices != range1.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in emptyCollection.indices != !range1.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in emptyCollection.indices) != !range1.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in emptyCollection.indices) != range1.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in emptyCollection.indices != range1.contains(element29)) throw AssertionError() + if (element29 !in emptyCollection.indices != !range1.contains(element29)) throw AssertionError() + if (!(element29 in emptyCollection.indices) != !range1.contains(element29)) throw AssertionError() + if (!(element29 !in emptyCollection.indices) != range1.contains(element29)) throw AssertionError() +} + +fun testR1xE30() { + // with possible local optimizations + if (4.toByte() in emptyCollection.indices != range1.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in emptyCollection.indices != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in emptyCollection.indices) != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in emptyCollection.indices) != range1.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in emptyCollection.indices != range1.contains(element30)) throw AssertionError() + if (element30 !in emptyCollection.indices != !range1.contains(element30)) throw AssertionError() + if (!(element30 in emptyCollection.indices) != !range1.contains(element30)) throw AssertionError() + if (!(element30 !in emptyCollection.indices) != range1.contains(element30)) throw AssertionError() +} + +fun testR1xE31() { + // with possible local optimizations + if (4.toShort() in emptyCollection.indices != range1.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in emptyCollection.indices != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in emptyCollection.indices) != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in emptyCollection.indices) != range1.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in emptyCollection.indices != range1.contains(element31)) throw AssertionError() + if (element31 !in emptyCollection.indices != !range1.contains(element31)) throw AssertionError() + if (!(element31 in emptyCollection.indices) != !range1.contains(element31)) throw AssertionError() + if (!(element31 !in emptyCollection.indices) != range1.contains(element31)) throw AssertionError() +} + +fun testR1xE32() { + // with possible local optimizations + if (4 in emptyCollection.indices != range1.contains(4)) throw AssertionError() + if (4 !in emptyCollection.indices != !range1.contains(4)) throw AssertionError() + if (!(4 in emptyCollection.indices) != !range1.contains(4)) throw AssertionError() + if (!(4 !in emptyCollection.indices) != range1.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in emptyCollection.indices != range1.contains(element32)) throw AssertionError() + if (element32 !in emptyCollection.indices != !range1.contains(element32)) throw AssertionError() + if (!(element32 in emptyCollection.indices) != !range1.contains(element32)) throw AssertionError() + if (!(element32 !in emptyCollection.indices) != range1.contains(element32)) throw AssertionError() +} + +fun testR1xE33() { + // with possible local optimizations + if (4.toLong() in emptyCollection.indices != range1.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in emptyCollection.indices != !range1.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in emptyCollection.indices) != !range1.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in emptyCollection.indices) != range1.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in emptyCollection.indices != range1.contains(element33)) throw AssertionError() + if (element33 !in emptyCollection.indices != !range1.contains(element33)) throw AssertionError() + if (!(element33 in emptyCollection.indices) != !range1.contains(element33)) throw AssertionError() + if (!(element33 !in emptyCollection.indices) != range1.contains(element33)) throw AssertionError() +} + +fun testR1xE34() { + // with possible local optimizations + if (4.toFloat() in emptyCollection.indices != range1.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in emptyCollection.indices != !range1.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in emptyCollection.indices) != !range1.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in emptyCollection.indices) != range1.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in emptyCollection.indices != range1.contains(element34)) throw AssertionError() + if (element34 !in emptyCollection.indices != !range1.contains(element34)) throw AssertionError() + if (!(element34 in emptyCollection.indices) != !range1.contains(element34)) throw AssertionError() + if (!(element34 !in emptyCollection.indices) != range1.contains(element34)) throw AssertionError() +} + +fun testR1xE35() { + // with possible local optimizations + if (4.toDouble() in emptyCollection.indices != range1.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in emptyCollection.indices != !range1.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in emptyCollection.indices) != !range1.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in emptyCollection.indices) != range1.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in emptyCollection.indices != range1.contains(element35)) throw AssertionError() + if (element35 !in emptyCollection.indices != !range1.contains(element35)) throw AssertionError() + if (!(element35 in emptyCollection.indices) != !range1.contains(element35)) throw AssertionError() + if (!(element35 !in emptyCollection.indices) != range1.contains(element35)) throw AssertionError() +} + + diff --git a/backend.native/tests/external/codegen/box/ranges/contains/generated/doubleRangeLiteral.kt b/backend.native/tests/external/codegen/box/ranges/contains/generated/doubleRangeLiteral.kt new file mode 100644 index 00000000000..aee5167c174 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/generated/doubleRangeLiteral.kt @@ -0,0 +1,1058 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_RUNTIME + + + +val range0 = 1.0 .. 3.0 +val range1 = 3.0 .. 1.0 + +val element0 = (-1).toByte() +val element1 = (-1).toShort() +val element2 = (-1) +val element3 = (-1).toLong() +val element4 = (-1).toFloat() +val element5 = (-1).toDouble() +val element6 = 0.toByte() +val element7 = 0.toShort() +val element8 = 0 +val element9 = 0.toLong() +val element10 = 0.toFloat() +val element11 = 0.toDouble() +val element12 = 1.toByte() +val element13 = 1.toShort() +val element14 = 1 +val element15 = 1.toLong() +val element16 = 1.toFloat() +val element17 = 1.toDouble() +val element18 = 2.toByte() +val element19 = 2.toShort() +val element20 = 2 +val element21 = 2.toLong() +val element22 = 2.toFloat() +val element23 = 2.toDouble() +val element24 = 3.toByte() +val element25 = 3.toShort() +val element26 = 3 +val element27 = 3.toLong() +val element28 = 3.toFloat() +val element29 = 3.toDouble() +val element30 = 4.toByte() +val element31 = 4.toShort() +val element32 = 4 +val element33 = 4.toLong() +val element34 = 4.toFloat() +val element35 = 4.toDouble() + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR0xE5() + testR0xE6() + testR0xE7() + testR0xE8() + testR0xE9() + testR0xE10() + testR0xE11() + testR0xE12() + testR0xE13() + testR0xE14() + testR0xE15() + testR0xE16() + testR0xE17() + testR0xE18() + testR0xE19() + testR0xE20() + testR0xE21() + testR0xE22() + testR0xE23() + testR0xE24() + testR0xE25() + testR0xE26() + testR0xE27() + testR0xE28() + testR0xE29() + testR0xE30() + testR0xE31() + testR0xE32() + testR0xE33() + testR0xE34() + testR0xE35() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + testR1xE5() + testR1xE6() + testR1xE7() + testR1xE8() + testR1xE9() + testR1xE10() + testR1xE11() + testR1xE12() + testR1xE13() + testR1xE14() + testR1xE15() + testR1xE16() + testR1xE17() + testR1xE18() + testR1xE19() + testR1xE20() + testR1xE21() + testR1xE22() + testR1xE23() + testR1xE24() + testR1xE25() + testR1xE26() + testR1xE27() + testR1xE28() + testR1xE29() + testR1xE30() + testR1xE31() + testR1xE32() + testR1xE33() + testR1xE34() + testR1xE35() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if ((-1).toByte() in 1.0 .. 3.0 != range0.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 1.0 .. 3.0 != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 1.0 .. 3.0) != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 1.0 .. 3.0) != range0.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 1.0 .. 3.0 != range0.contains(element0)) throw AssertionError() + if (element0 !in 1.0 .. 3.0 != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1.0 .. 3.0) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1.0 .. 3.0) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if ((-1).toShort() in 1.0 .. 3.0 != range0.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 1.0 .. 3.0 != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 1.0 .. 3.0) != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 1.0 .. 3.0) != range0.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 1.0 .. 3.0 != range0.contains(element1)) throw AssertionError() + if (element1 !in 1.0 .. 3.0 != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1.0 .. 3.0) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1.0 .. 3.0) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if ((-1) in 1.0 .. 3.0 != range0.contains((-1))) throw AssertionError() + if ((-1) !in 1.0 .. 3.0 != !range0.contains((-1))) throw AssertionError() + if (!((-1) in 1.0 .. 3.0) != !range0.contains((-1))) throw AssertionError() + if (!((-1) !in 1.0 .. 3.0) != range0.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in 1.0 .. 3.0 != range0.contains(element2)) throw AssertionError() + if (element2 !in 1.0 .. 3.0 != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1.0 .. 3.0) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1.0 .. 3.0) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if ((-1).toLong() in 1.0 .. 3.0 != range0.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in 1.0 .. 3.0 != !range0.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in 1.0 .. 3.0) != !range0.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in 1.0 .. 3.0) != range0.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in 1.0 .. 3.0 != range0.contains(element3)) throw AssertionError() + if (element3 !in 1.0 .. 3.0 != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1.0 .. 3.0) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1.0 .. 3.0) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if ((-1).toFloat() in 1.0 .. 3.0 != range0.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in 1.0 .. 3.0 != !range0.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in 1.0 .. 3.0) != !range0.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in 1.0 .. 3.0) != range0.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in 1.0 .. 3.0 != range0.contains(element4)) throw AssertionError() + if (element4 !in 1.0 .. 3.0 != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1.0 .. 3.0) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1.0 .. 3.0) != range0.contains(element4)) throw AssertionError() +} + +fun testR0xE5() { + // with possible local optimizations + if ((-1).toDouble() in 1.0 .. 3.0 != range0.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in 1.0 .. 3.0 != !range0.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in 1.0 .. 3.0) != !range0.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in 1.0 .. 3.0) != range0.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in 1.0 .. 3.0 != range0.contains(element5)) throw AssertionError() + if (element5 !in 1.0 .. 3.0 != !range0.contains(element5)) throw AssertionError() + if (!(element5 in 1.0 .. 3.0) != !range0.contains(element5)) throw AssertionError() + if (!(element5 !in 1.0 .. 3.0) != range0.contains(element5)) throw AssertionError() +} + +fun testR0xE6() { + // with possible local optimizations + if (0.toByte() in 1.0 .. 3.0 != range0.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 1.0 .. 3.0 != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 1.0 .. 3.0) != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 1.0 .. 3.0) != range0.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in 1.0 .. 3.0 != range0.contains(element6)) throw AssertionError() + if (element6 !in 1.0 .. 3.0 != !range0.contains(element6)) throw AssertionError() + if (!(element6 in 1.0 .. 3.0) != !range0.contains(element6)) throw AssertionError() + if (!(element6 !in 1.0 .. 3.0) != range0.contains(element6)) throw AssertionError() +} + +fun testR0xE7() { + // with possible local optimizations + if (0.toShort() in 1.0 .. 3.0 != range0.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 1.0 .. 3.0 != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 1.0 .. 3.0) != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 1.0 .. 3.0) != range0.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in 1.0 .. 3.0 != range0.contains(element7)) throw AssertionError() + if (element7 !in 1.0 .. 3.0 != !range0.contains(element7)) throw AssertionError() + if (!(element7 in 1.0 .. 3.0) != !range0.contains(element7)) throw AssertionError() + if (!(element7 !in 1.0 .. 3.0) != range0.contains(element7)) throw AssertionError() +} + +fun testR0xE8() { + // with possible local optimizations + if (0 in 1.0 .. 3.0 != range0.contains(0)) throw AssertionError() + if (0 !in 1.0 .. 3.0 != !range0.contains(0)) throw AssertionError() + if (!(0 in 1.0 .. 3.0) != !range0.contains(0)) throw AssertionError() + if (!(0 !in 1.0 .. 3.0) != range0.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in 1.0 .. 3.0 != range0.contains(element8)) throw AssertionError() + if (element8 !in 1.0 .. 3.0 != !range0.contains(element8)) throw AssertionError() + if (!(element8 in 1.0 .. 3.0) != !range0.contains(element8)) throw AssertionError() + if (!(element8 !in 1.0 .. 3.0) != range0.contains(element8)) throw AssertionError() +} + +fun testR0xE9() { + // with possible local optimizations + if (0.toLong() in 1.0 .. 3.0 != range0.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in 1.0 .. 3.0 != !range0.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in 1.0 .. 3.0) != !range0.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in 1.0 .. 3.0) != range0.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in 1.0 .. 3.0 != range0.contains(element9)) throw AssertionError() + if (element9 !in 1.0 .. 3.0 != !range0.contains(element9)) throw AssertionError() + if (!(element9 in 1.0 .. 3.0) != !range0.contains(element9)) throw AssertionError() + if (!(element9 !in 1.0 .. 3.0) != range0.contains(element9)) throw AssertionError() +} + +fun testR0xE10() { + // with possible local optimizations + if (0.toFloat() in 1.0 .. 3.0 != range0.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in 1.0 .. 3.0 != !range0.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in 1.0 .. 3.0) != !range0.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in 1.0 .. 3.0) != range0.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in 1.0 .. 3.0 != range0.contains(element10)) throw AssertionError() + if (element10 !in 1.0 .. 3.0 != !range0.contains(element10)) throw AssertionError() + if (!(element10 in 1.0 .. 3.0) != !range0.contains(element10)) throw AssertionError() + if (!(element10 !in 1.0 .. 3.0) != range0.contains(element10)) throw AssertionError() +} + +fun testR0xE11() { + // with possible local optimizations + if (0.toDouble() in 1.0 .. 3.0 != range0.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in 1.0 .. 3.0 != !range0.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in 1.0 .. 3.0) != !range0.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in 1.0 .. 3.0) != range0.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in 1.0 .. 3.0 != range0.contains(element11)) throw AssertionError() + if (element11 !in 1.0 .. 3.0 != !range0.contains(element11)) throw AssertionError() + if (!(element11 in 1.0 .. 3.0) != !range0.contains(element11)) throw AssertionError() + if (!(element11 !in 1.0 .. 3.0) != range0.contains(element11)) throw AssertionError() +} + +fun testR0xE12() { + // with possible local optimizations + if (1.toByte() in 1.0 .. 3.0 != range0.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 1.0 .. 3.0 != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 1.0 .. 3.0) != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 1.0 .. 3.0) != range0.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 1.0 .. 3.0 != range0.contains(element12)) throw AssertionError() + if (element12 !in 1.0 .. 3.0 != !range0.contains(element12)) throw AssertionError() + if (!(element12 in 1.0 .. 3.0) != !range0.contains(element12)) throw AssertionError() + if (!(element12 !in 1.0 .. 3.0) != range0.contains(element12)) throw AssertionError() +} + +fun testR0xE13() { + // with possible local optimizations + if (1.toShort() in 1.0 .. 3.0 != range0.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 1.0 .. 3.0 != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 1.0 .. 3.0) != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 1.0 .. 3.0) != range0.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 1.0 .. 3.0 != range0.contains(element13)) throw AssertionError() + if (element13 !in 1.0 .. 3.0 != !range0.contains(element13)) throw AssertionError() + if (!(element13 in 1.0 .. 3.0) != !range0.contains(element13)) throw AssertionError() + if (!(element13 !in 1.0 .. 3.0) != range0.contains(element13)) throw AssertionError() +} + +fun testR0xE14() { + // with possible local optimizations + if (1 in 1.0 .. 3.0 != range0.contains(1)) throw AssertionError() + if (1 !in 1.0 .. 3.0 != !range0.contains(1)) throw AssertionError() + if (!(1 in 1.0 .. 3.0) != !range0.contains(1)) throw AssertionError() + if (!(1 !in 1.0 .. 3.0) != range0.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in 1.0 .. 3.0 != range0.contains(element14)) throw AssertionError() + if (element14 !in 1.0 .. 3.0 != !range0.contains(element14)) throw AssertionError() + if (!(element14 in 1.0 .. 3.0) != !range0.contains(element14)) throw AssertionError() + if (!(element14 !in 1.0 .. 3.0) != range0.contains(element14)) throw AssertionError() +} + +fun testR0xE15() { + // with possible local optimizations + if (1.toLong() in 1.0 .. 3.0 != range0.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in 1.0 .. 3.0 != !range0.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in 1.0 .. 3.0) != !range0.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in 1.0 .. 3.0) != range0.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in 1.0 .. 3.0 != range0.contains(element15)) throw AssertionError() + if (element15 !in 1.0 .. 3.0 != !range0.contains(element15)) throw AssertionError() + if (!(element15 in 1.0 .. 3.0) != !range0.contains(element15)) throw AssertionError() + if (!(element15 !in 1.0 .. 3.0) != range0.contains(element15)) throw AssertionError() +} + +fun testR0xE16() { + // with possible local optimizations + if (1.toFloat() in 1.0 .. 3.0 != range0.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in 1.0 .. 3.0 != !range0.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in 1.0 .. 3.0) != !range0.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in 1.0 .. 3.0) != range0.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in 1.0 .. 3.0 != range0.contains(element16)) throw AssertionError() + if (element16 !in 1.0 .. 3.0 != !range0.contains(element16)) throw AssertionError() + if (!(element16 in 1.0 .. 3.0) != !range0.contains(element16)) throw AssertionError() + if (!(element16 !in 1.0 .. 3.0) != range0.contains(element16)) throw AssertionError() +} + +fun testR0xE17() { + // with possible local optimizations + if (1.toDouble() in 1.0 .. 3.0 != range0.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in 1.0 .. 3.0 != !range0.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in 1.0 .. 3.0) != !range0.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in 1.0 .. 3.0) != range0.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in 1.0 .. 3.0 != range0.contains(element17)) throw AssertionError() + if (element17 !in 1.0 .. 3.0 != !range0.contains(element17)) throw AssertionError() + if (!(element17 in 1.0 .. 3.0) != !range0.contains(element17)) throw AssertionError() + if (!(element17 !in 1.0 .. 3.0) != range0.contains(element17)) throw AssertionError() +} + +fun testR0xE18() { + // with possible local optimizations + if (2.toByte() in 1.0 .. 3.0 != range0.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 1.0 .. 3.0 != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 1.0 .. 3.0) != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 1.0 .. 3.0) != range0.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in 1.0 .. 3.0 != range0.contains(element18)) throw AssertionError() + if (element18 !in 1.0 .. 3.0 != !range0.contains(element18)) throw AssertionError() + if (!(element18 in 1.0 .. 3.0) != !range0.contains(element18)) throw AssertionError() + if (!(element18 !in 1.0 .. 3.0) != range0.contains(element18)) throw AssertionError() +} + +fun testR0xE19() { + // with possible local optimizations + if (2.toShort() in 1.0 .. 3.0 != range0.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 1.0 .. 3.0 != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 1.0 .. 3.0) != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 1.0 .. 3.0) != range0.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in 1.0 .. 3.0 != range0.contains(element19)) throw AssertionError() + if (element19 !in 1.0 .. 3.0 != !range0.contains(element19)) throw AssertionError() + if (!(element19 in 1.0 .. 3.0) != !range0.contains(element19)) throw AssertionError() + if (!(element19 !in 1.0 .. 3.0) != range0.contains(element19)) throw AssertionError() +} + +fun testR0xE20() { + // with possible local optimizations + if (2 in 1.0 .. 3.0 != range0.contains(2)) throw AssertionError() + if (2 !in 1.0 .. 3.0 != !range0.contains(2)) throw AssertionError() + if (!(2 in 1.0 .. 3.0) != !range0.contains(2)) throw AssertionError() + if (!(2 !in 1.0 .. 3.0) != range0.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in 1.0 .. 3.0 != range0.contains(element20)) throw AssertionError() + if (element20 !in 1.0 .. 3.0 != !range0.contains(element20)) throw AssertionError() + if (!(element20 in 1.0 .. 3.0) != !range0.contains(element20)) throw AssertionError() + if (!(element20 !in 1.0 .. 3.0) != range0.contains(element20)) throw AssertionError() +} + +fun testR0xE21() { + // with possible local optimizations + if (2.toLong() in 1.0 .. 3.0 != range0.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in 1.0 .. 3.0 != !range0.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in 1.0 .. 3.0) != !range0.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in 1.0 .. 3.0) != range0.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in 1.0 .. 3.0 != range0.contains(element21)) throw AssertionError() + if (element21 !in 1.0 .. 3.0 != !range0.contains(element21)) throw AssertionError() + if (!(element21 in 1.0 .. 3.0) != !range0.contains(element21)) throw AssertionError() + if (!(element21 !in 1.0 .. 3.0) != range0.contains(element21)) throw AssertionError() +} + +fun testR0xE22() { + // with possible local optimizations + if (2.toFloat() in 1.0 .. 3.0 != range0.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in 1.0 .. 3.0 != !range0.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in 1.0 .. 3.0) != !range0.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in 1.0 .. 3.0) != range0.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in 1.0 .. 3.0 != range0.contains(element22)) throw AssertionError() + if (element22 !in 1.0 .. 3.0 != !range0.contains(element22)) throw AssertionError() + if (!(element22 in 1.0 .. 3.0) != !range0.contains(element22)) throw AssertionError() + if (!(element22 !in 1.0 .. 3.0) != range0.contains(element22)) throw AssertionError() +} + +fun testR0xE23() { + // with possible local optimizations + if (2.toDouble() in 1.0 .. 3.0 != range0.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in 1.0 .. 3.0 != !range0.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in 1.0 .. 3.0) != !range0.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in 1.0 .. 3.0) != range0.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in 1.0 .. 3.0 != range0.contains(element23)) throw AssertionError() + if (element23 !in 1.0 .. 3.0 != !range0.contains(element23)) throw AssertionError() + if (!(element23 in 1.0 .. 3.0) != !range0.contains(element23)) throw AssertionError() + if (!(element23 !in 1.0 .. 3.0) != range0.contains(element23)) throw AssertionError() +} + +fun testR0xE24() { + // with possible local optimizations + if (3.toByte() in 1.0 .. 3.0 != range0.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 1.0 .. 3.0 != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 1.0 .. 3.0) != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 1.0 .. 3.0) != range0.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in 1.0 .. 3.0 != range0.contains(element24)) throw AssertionError() + if (element24 !in 1.0 .. 3.0 != !range0.contains(element24)) throw AssertionError() + if (!(element24 in 1.0 .. 3.0) != !range0.contains(element24)) throw AssertionError() + if (!(element24 !in 1.0 .. 3.0) != range0.contains(element24)) throw AssertionError() +} + +fun testR0xE25() { + // with possible local optimizations + if (3.toShort() in 1.0 .. 3.0 != range0.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 1.0 .. 3.0 != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 1.0 .. 3.0) != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 1.0 .. 3.0) != range0.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in 1.0 .. 3.0 != range0.contains(element25)) throw AssertionError() + if (element25 !in 1.0 .. 3.0 != !range0.contains(element25)) throw AssertionError() + if (!(element25 in 1.0 .. 3.0) != !range0.contains(element25)) throw AssertionError() + if (!(element25 !in 1.0 .. 3.0) != range0.contains(element25)) throw AssertionError() +} + +fun testR0xE26() { + // with possible local optimizations + if (3 in 1.0 .. 3.0 != range0.contains(3)) throw AssertionError() + if (3 !in 1.0 .. 3.0 != !range0.contains(3)) throw AssertionError() + if (!(3 in 1.0 .. 3.0) != !range0.contains(3)) throw AssertionError() + if (!(3 !in 1.0 .. 3.0) != range0.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in 1.0 .. 3.0 != range0.contains(element26)) throw AssertionError() + if (element26 !in 1.0 .. 3.0 != !range0.contains(element26)) throw AssertionError() + if (!(element26 in 1.0 .. 3.0) != !range0.contains(element26)) throw AssertionError() + if (!(element26 !in 1.0 .. 3.0) != range0.contains(element26)) throw AssertionError() +} + +fun testR0xE27() { + // with possible local optimizations + if (3.toLong() in 1.0 .. 3.0 != range0.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in 1.0 .. 3.0 != !range0.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in 1.0 .. 3.0) != !range0.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in 1.0 .. 3.0) != range0.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in 1.0 .. 3.0 != range0.contains(element27)) throw AssertionError() + if (element27 !in 1.0 .. 3.0 != !range0.contains(element27)) throw AssertionError() + if (!(element27 in 1.0 .. 3.0) != !range0.contains(element27)) throw AssertionError() + if (!(element27 !in 1.0 .. 3.0) != range0.contains(element27)) throw AssertionError() +} + +fun testR0xE28() { + // with possible local optimizations + if (3.toFloat() in 1.0 .. 3.0 != range0.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in 1.0 .. 3.0 != !range0.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in 1.0 .. 3.0) != !range0.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in 1.0 .. 3.0) != range0.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in 1.0 .. 3.0 != range0.contains(element28)) throw AssertionError() + if (element28 !in 1.0 .. 3.0 != !range0.contains(element28)) throw AssertionError() + if (!(element28 in 1.0 .. 3.0) != !range0.contains(element28)) throw AssertionError() + if (!(element28 !in 1.0 .. 3.0) != range0.contains(element28)) throw AssertionError() +} + +fun testR0xE29() { + // with possible local optimizations + if (3.toDouble() in 1.0 .. 3.0 != range0.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in 1.0 .. 3.0 != !range0.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in 1.0 .. 3.0) != !range0.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in 1.0 .. 3.0) != range0.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in 1.0 .. 3.0 != range0.contains(element29)) throw AssertionError() + if (element29 !in 1.0 .. 3.0 != !range0.contains(element29)) throw AssertionError() + if (!(element29 in 1.0 .. 3.0) != !range0.contains(element29)) throw AssertionError() + if (!(element29 !in 1.0 .. 3.0) != range0.contains(element29)) throw AssertionError() +} + +fun testR0xE30() { + // with possible local optimizations + if (4.toByte() in 1.0 .. 3.0 != range0.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 1.0 .. 3.0 != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 1.0 .. 3.0) != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 1.0 .. 3.0) != range0.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in 1.0 .. 3.0 != range0.contains(element30)) throw AssertionError() + if (element30 !in 1.0 .. 3.0 != !range0.contains(element30)) throw AssertionError() + if (!(element30 in 1.0 .. 3.0) != !range0.contains(element30)) throw AssertionError() + if (!(element30 !in 1.0 .. 3.0) != range0.contains(element30)) throw AssertionError() +} + +fun testR0xE31() { + // with possible local optimizations + if (4.toShort() in 1.0 .. 3.0 != range0.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 1.0 .. 3.0 != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 1.0 .. 3.0) != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 1.0 .. 3.0) != range0.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in 1.0 .. 3.0 != range0.contains(element31)) throw AssertionError() + if (element31 !in 1.0 .. 3.0 != !range0.contains(element31)) throw AssertionError() + if (!(element31 in 1.0 .. 3.0) != !range0.contains(element31)) throw AssertionError() + if (!(element31 !in 1.0 .. 3.0) != range0.contains(element31)) throw AssertionError() +} + +fun testR0xE32() { + // with possible local optimizations + if (4 in 1.0 .. 3.0 != range0.contains(4)) throw AssertionError() + if (4 !in 1.0 .. 3.0 != !range0.contains(4)) throw AssertionError() + if (!(4 in 1.0 .. 3.0) != !range0.contains(4)) throw AssertionError() + if (!(4 !in 1.0 .. 3.0) != range0.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in 1.0 .. 3.0 != range0.contains(element32)) throw AssertionError() + if (element32 !in 1.0 .. 3.0 != !range0.contains(element32)) throw AssertionError() + if (!(element32 in 1.0 .. 3.0) != !range0.contains(element32)) throw AssertionError() + if (!(element32 !in 1.0 .. 3.0) != range0.contains(element32)) throw AssertionError() +} + +fun testR0xE33() { + // with possible local optimizations + if (4.toLong() in 1.0 .. 3.0 != range0.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in 1.0 .. 3.0 != !range0.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in 1.0 .. 3.0) != !range0.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in 1.0 .. 3.0) != range0.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in 1.0 .. 3.0 != range0.contains(element33)) throw AssertionError() + if (element33 !in 1.0 .. 3.0 != !range0.contains(element33)) throw AssertionError() + if (!(element33 in 1.0 .. 3.0) != !range0.contains(element33)) throw AssertionError() + if (!(element33 !in 1.0 .. 3.0) != range0.contains(element33)) throw AssertionError() +} + +fun testR0xE34() { + // with possible local optimizations + if (4.toFloat() in 1.0 .. 3.0 != range0.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in 1.0 .. 3.0 != !range0.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in 1.0 .. 3.0) != !range0.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in 1.0 .. 3.0) != range0.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in 1.0 .. 3.0 != range0.contains(element34)) throw AssertionError() + if (element34 !in 1.0 .. 3.0 != !range0.contains(element34)) throw AssertionError() + if (!(element34 in 1.0 .. 3.0) != !range0.contains(element34)) throw AssertionError() + if (!(element34 !in 1.0 .. 3.0) != range0.contains(element34)) throw AssertionError() +} + +fun testR0xE35() { + // with possible local optimizations + if (4.toDouble() in 1.0 .. 3.0 != range0.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in 1.0 .. 3.0 != !range0.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in 1.0 .. 3.0) != !range0.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in 1.0 .. 3.0) != range0.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in 1.0 .. 3.0 != range0.contains(element35)) throw AssertionError() + if (element35 !in 1.0 .. 3.0 != !range0.contains(element35)) throw AssertionError() + if (!(element35 in 1.0 .. 3.0) != !range0.contains(element35)) throw AssertionError() + if (!(element35 !in 1.0 .. 3.0) != range0.contains(element35)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if ((-1).toByte() in 3.0 .. 1.0 != range1.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 3.0 .. 1.0 != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 3.0 .. 1.0) != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 3.0 .. 1.0) != range1.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 3.0 .. 1.0 != range1.contains(element0)) throw AssertionError() + if (element0 !in 3.0 .. 1.0 != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3.0 .. 1.0) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3.0 .. 1.0) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if ((-1).toShort() in 3.0 .. 1.0 != range1.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 3.0 .. 1.0 != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 3.0 .. 1.0) != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 3.0 .. 1.0) != range1.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 3.0 .. 1.0 != range1.contains(element1)) throw AssertionError() + if (element1 !in 3.0 .. 1.0 != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3.0 .. 1.0) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3.0 .. 1.0) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if ((-1) in 3.0 .. 1.0 != range1.contains((-1))) throw AssertionError() + if ((-1) !in 3.0 .. 1.0 != !range1.contains((-1))) throw AssertionError() + if (!((-1) in 3.0 .. 1.0) != !range1.contains((-1))) throw AssertionError() + if (!((-1) !in 3.0 .. 1.0) != range1.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in 3.0 .. 1.0 != range1.contains(element2)) throw AssertionError() + if (element2 !in 3.0 .. 1.0 != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3.0 .. 1.0) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3.0 .. 1.0) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if ((-1).toLong() in 3.0 .. 1.0 != range1.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in 3.0 .. 1.0 != !range1.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in 3.0 .. 1.0) != !range1.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in 3.0 .. 1.0) != range1.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in 3.0 .. 1.0 != range1.contains(element3)) throw AssertionError() + if (element3 !in 3.0 .. 1.0 != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3.0 .. 1.0) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3.0 .. 1.0) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if ((-1).toFloat() in 3.0 .. 1.0 != range1.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in 3.0 .. 1.0 != !range1.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in 3.0 .. 1.0) != !range1.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in 3.0 .. 1.0) != range1.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in 3.0 .. 1.0 != range1.contains(element4)) throw AssertionError() + if (element4 !in 3.0 .. 1.0 != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3.0 .. 1.0) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3.0 .. 1.0) != range1.contains(element4)) throw AssertionError() +} + +fun testR1xE5() { + // with possible local optimizations + if ((-1).toDouble() in 3.0 .. 1.0 != range1.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in 3.0 .. 1.0 != !range1.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in 3.0 .. 1.0) != !range1.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in 3.0 .. 1.0) != range1.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in 3.0 .. 1.0 != range1.contains(element5)) throw AssertionError() + if (element5 !in 3.0 .. 1.0 != !range1.contains(element5)) throw AssertionError() + if (!(element5 in 3.0 .. 1.0) != !range1.contains(element5)) throw AssertionError() + if (!(element5 !in 3.0 .. 1.0) != range1.contains(element5)) throw AssertionError() +} + +fun testR1xE6() { + // with possible local optimizations + if (0.toByte() in 3.0 .. 1.0 != range1.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 3.0 .. 1.0 != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 3.0 .. 1.0) != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 3.0 .. 1.0) != range1.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in 3.0 .. 1.0 != range1.contains(element6)) throw AssertionError() + if (element6 !in 3.0 .. 1.0 != !range1.contains(element6)) throw AssertionError() + if (!(element6 in 3.0 .. 1.0) != !range1.contains(element6)) throw AssertionError() + if (!(element6 !in 3.0 .. 1.0) != range1.contains(element6)) throw AssertionError() +} + +fun testR1xE7() { + // with possible local optimizations + if (0.toShort() in 3.0 .. 1.0 != range1.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 3.0 .. 1.0 != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 3.0 .. 1.0) != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 3.0 .. 1.0) != range1.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in 3.0 .. 1.0 != range1.contains(element7)) throw AssertionError() + if (element7 !in 3.0 .. 1.0 != !range1.contains(element7)) throw AssertionError() + if (!(element7 in 3.0 .. 1.0) != !range1.contains(element7)) throw AssertionError() + if (!(element7 !in 3.0 .. 1.0) != range1.contains(element7)) throw AssertionError() +} + +fun testR1xE8() { + // with possible local optimizations + if (0 in 3.0 .. 1.0 != range1.contains(0)) throw AssertionError() + if (0 !in 3.0 .. 1.0 != !range1.contains(0)) throw AssertionError() + if (!(0 in 3.0 .. 1.0) != !range1.contains(0)) throw AssertionError() + if (!(0 !in 3.0 .. 1.0) != range1.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in 3.0 .. 1.0 != range1.contains(element8)) throw AssertionError() + if (element8 !in 3.0 .. 1.0 != !range1.contains(element8)) throw AssertionError() + if (!(element8 in 3.0 .. 1.0) != !range1.contains(element8)) throw AssertionError() + if (!(element8 !in 3.0 .. 1.0) != range1.contains(element8)) throw AssertionError() +} + +fun testR1xE9() { + // with possible local optimizations + if (0.toLong() in 3.0 .. 1.0 != range1.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in 3.0 .. 1.0 != !range1.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in 3.0 .. 1.0) != !range1.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in 3.0 .. 1.0) != range1.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in 3.0 .. 1.0 != range1.contains(element9)) throw AssertionError() + if (element9 !in 3.0 .. 1.0 != !range1.contains(element9)) throw AssertionError() + if (!(element9 in 3.0 .. 1.0) != !range1.contains(element9)) throw AssertionError() + if (!(element9 !in 3.0 .. 1.0) != range1.contains(element9)) throw AssertionError() +} + +fun testR1xE10() { + // with possible local optimizations + if (0.toFloat() in 3.0 .. 1.0 != range1.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in 3.0 .. 1.0 != !range1.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in 3.0 .. 1.0) != !range1.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in 3.0 .. 1.0) != range1.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in 3.0 .. 1.0 != range1.contains(element10)) throw AssertionError() + if (element10 !in 3.0 .. 1.0 != !range1.contains(element10)) throw AssertionError() + if (!(element10 in 3.0 .. 1.0) != !range1.contains(element10)) throw AssertionError() + if (!(element10 !in 3.0 .. 1.0) != range1.contains(element10)) throw AssertionError() +} + +fun testR1xE11() { + // with possible local optimizations + if (0.toDouble() in 3.0 .. 1.0 != range1.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in 3.0 .. 1.0 != !range1.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in 3.0 .. 1.0) != !range1.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in 3.0 .. 1.0) != range1.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in 3.0 .. 1.0 != range1.contains(element11)) throw AssertionError() + if (element11 !in 3.0 .. 1.0 != !range1.contains(element11)) throw AssertionError() + if (!(element11 in 3.0 .. 1.0) != !range1.contains(element11)) throw AssertionError() + if (!(element11 !in 3.0 .. 1.0) != range1.contains(element11)) throw AssertionError() +} + +fun testR1xE12() { + // with possible local optimizations + if (1.toByte() in 3.0 .. 1.0 != range1.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 3.0 .. 1.0 != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 3.0 .. 1.0) != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 3.0 .. 1.0) != range1.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 3.0 .. 1.0 != range1.contains(element12)) throw AssertionError() + if (element12 !in 3.0 .. 1.0 != !range1.contains(element12)) throw AssertionError() + if (!(element12 in 3.0 .. 1.0) != !range1.contains(element12)) throw AssertionError() + if (!(element12 !in 3.0 .. 1.0) != range1.contains(element12)) throw AssertionError() +} + +fun testR1xE13() { + // with possible local optimizations + if (1.toShort() in 3.0 .. 1.0 != range1.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 3.0 .. 1.0 != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 3.0 .. 1.0) != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 3.0 .. 1.0) != range1.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 3.0 .. 1.0 != range1.contains(element13)) throw AssertionError() + if (element13 !in 3.0 .. 1.0 != !range1.contains(element13)) throw AssertionError() + if (!(element13 in 3.0 .. 1.0) != !range1.contains(element13)) throw AssertionError() + if (!(element13 !in 3.0 .. 1.0) != range1.contains(element13)) throw AssertionError() +} + +fun testR1xE14() { + // with possible local optimizations + if (1 in 3.0 .. 1.0 != range1.contains(1)) throw AssertionError() + if (1 !in 3.0 .. 1.0 != !range1.contains(1)) throw AssertionError() + if (!(1 in 3.0 .. 1.0) != !range1.contains(1)) throw AssertionError() + if (!(1 !in 3.0 .. 1.0) != range1.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in 3.0 .. 1.0 != range1.contains(element14)) throw AssertionError() + if (element14 !in 3.0 .. 1.0 != !range1.contains(element14)) throw AssertionError() + if (!(element14 in 3.0 .. 1.0) != !range1.contains(element14)) throw AssertionError() + if (!(element14 !in 3.0 .. 1.0) != range1.contains(element14)) throw AssertionError() +} + +fun testR1xE15() { + // with possible local optimizations + if (1.toLong() in 3.0 .. 1.0 != range1.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in 3.0 .. 1.0 != !range1.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in 3.0 .. 1.0) != !range1.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in 3.0 .. 1.0) != range1.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in 3.0 .. 1.0 != range1.contains(element15)) throw AssertionError() + if (element15 !in 3.0 .. 1.0 != !range1.contains(element15)) throw AssertionError() + if (!(element15 in 3.0 .. 1.0) != !range1.contains(element15)) throw AssertionError() + if (!(element15 !in 3.0 .. 1.0) != range1.contains(element15)) throw AssertionError() +} + +fun testR1xE16() { + // with possible local optimizations + if (1.toFloat() in 3.0 .. 1.0 != range1.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in 3.0 .. 1.0 != !range1.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in 3.0 .. 1.0) != !range1.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in 3.0 .. 1.0) != range1.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in 3.0 .. 1.0 != range1.contains(element16)) throw AssertionError() + if (element16 !in 3.0 .. 1.0 != !range1.contains(element16)) throw AssertionError() + if (!(element16 in 3.0 .. 1.0) != !range1.contains(element16)) throw AssertionError() + if (!(element16 !in 3.0 .. 1.0) != range1.contains(element16)) throw AssertionError() +} + +fun testR1xE17() { + // with possible local optimizations + if (1.toDouble() in 3.0 .. 1.0 != range1.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in 3.0 .. 1.0 != !range1.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in 3.0 .. 1.0) != !range1.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in 3.0 .. 1.0) != range1.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in 3.0 .. 1.0 != range1.contains(element17)) throw AssertionError() + if (element17 !in 3.0 .. 1.0 != !range1.contains(element17)) throw AssertionError() + if (!(element17 in 3.0 .. 1.0) != !range1.contains(element17)) throw AssertionError() + if (!(element17 !in 3.0 .. 1.0) != range1.contains(element17)) throw AssertionError() +} + +fun testR1xE18() { + // with possible local optimizations + if (2.toByte() in 3.0 .. 1.0 != range1.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 3.0 .. 1.0 != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 3.0 .. 1.0) != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 3.0 .. 1.0) != range1.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in 3.0 .. 1.0 != range1.contains(element18)) throw AssertionError() + if (element18 !in 3.0 .. 1.0 != !range1.contains(element18)) throw AssertionError() + if (!(element18 in 3.0 .. 1.0) != !range1.contains(element18)) throw AssertionError() + if (!(element18 !in 3.0 .. 1.0) != range1.contains(element18)) throw AssertionError() +} + +fun testR1xE19() { + // with possible local optimizations + if (2.toShort() in 3.0 .. 1.0 != range1.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 3.0 .. 1.0 != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 3.0 .. 1.0) != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 3.0 .. 1.0) != range1.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in 3.0 .. 1.0 != range1.contains(element19)) throw AssertionError() + if (element19 !in 3.0 .. 1.0 != !range1.contains(element19)) throw AssertionError() + if (!(element19 in 3.0 .. 1.0) != !range1.contains(element19)) throw AssertionError() + if (!(element19 !in 3.0 .. 1.0) != range1.contains(element19)) throw AssertionError() +} + +fun testR1xE20() { + // with possible local optimizations + if (2 in 3.0 .. 1.0 != range1.contains(2)) throw AssertionError() + if (2 !in 3.0 .. 1.0 != !range1.contains(2)) throw AssertionError() + if (!(2 in 3.0 .. 1.0) != !range1.contains(2)) throw AssertionError() + if (!(2 !in 3.0 .. 1.0) != range1.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in 3.0 .. 1.0 != range1.contains(element20)) throw AssertionError() + if (element20 !in 3.0 .. 1.0 != !range1.contains(element20)) throw AssertionError() + if (!(element20 in 3.0 .. 1.0) != !range1.contains(element20)) throw AssertionError() + if (!(element20 !in 3.0 .. 1.0) != range1.contains(element20)) throw AssertionError() +} + +fun testR1xE21() { + // with possible local optimizations + if (2.toLong() in 3.0 .. 1.0 != range1.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in 3.0 .. 1.0 != !range1.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in 3.0 .. 1.0) != !range1.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in 3.0 .. 1.0) != range1.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in 3.0 .. 1.0 != range1.contains(element21)) throw AssertionError() + if (element21 !in 3.0 .. 1.0 != !range1.contains(element21)) throw AssertionError() + if (!(element21 in 3.0 .. 1.0) != !range1.contains(element21)) throw AssertionError() + if (!(element21 !in 3.0 .. 1.0) != range1.contains(element21)) throw AssertionError() +} + +fun testR1xE22() { + // with possible local optimizations + if (2.toFloat() in 3.0 .. 1.0 != range1.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in 3.0 .. 1.0 != !range1.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in 3.0 .. 1.0) != !range1.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in 3.0 .. 1.0) != range1.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in 3.0 .. 1.0 != range1.contains(element22)) throw AssertionError() + if (element22 !in 3.0 .. 1.0 != !range1.contains(element22)) throw AssertionError() + if (!(element22 in 3.0 .. 1.0) != !range1.contains(element22)) throw AssertionError() + if (!(element22 !in 3.0 .. 1.0) != range1.contains(element22)) throw AssertionError() +} + +fun testR1xE23() { + // with possible local optimizations + if (2.toDouble() in 3.0 .. 1.0 != range1.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in 3.0 .. 1.0 != !range1.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in 3.0 .. 1.0) != !range1.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in 3.0 .. 1.0) != range1.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in 3.0 .. 1.0 != range1.contains(element23)) throw AssertionError() + if (element23 !in 3.0 .. 1.0 != !range1.contains(element23)) throw AssertionError() + if (!(element23 in 3.0 .. 1.0) != !range1.contains(element23)) throw AssertionError() + if (!(element23 !in 3.0 .. 1.0) != range1.contains(element23)) throw AssertionError() +} + +fun testR1xE24() { + // with possible local optimizations + if (3.toByte() in 3.0 .. 1.0 != range1.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 3.0 .. 1.0 != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 3.0 .. 1.0) != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 3.0 .. 1.0) != range1.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in 3.0 .. 1.0 != range1.contains(element24)) throw AssertionError() + if (element24 !in 3.0 .. 1.0 != !range1.contains(element24)) throw AssertionError() + if (!(element24 in 3.0 .. 1.0) != !range1.contains(element24)) throw AssertionError() + if (!(element24 !in 3.0 .. 1.0) != range1.contains(element24)) throw AssertionError() +} + +fun testR1xE25() { + // with possible local optimizations + if (3.toShort() in 3.0 .. 1.0 != range1.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 3.0 .. 1.0 != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 3.0 .. 1.0) != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 3.0 .. 1.0) != range1.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in 3.0 .. 1.0 != range1.contains(element25)) throw AssertionError() + if (element25 !in 3.0 .. 1.0 != !range1.contains(element25)) throw AssertionError() + if (!(element25 in 3.0 .. 1.0) != !range1.contains(element25)) throw AssertionError() + if (!(element25 !in 3.0 .. 1.0) != range1.contains(element25)) throw AssertionError() +} + +fun testR1xE26() { + // with possible local optimizations + if (3 in 3.0 .. 1.0 != range1.contains(3)) throw AssertionError() + if (3 !in 3.0 .. 1.0 != !range1.contains(3)) throw AssertionError() + if (!(3 in 3.0 .. 1.0) != !range1.contains(3)) throw AssertionError() + if (!(3 !in 3.0 .. 1.0) != range1.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in 3.0 .. 1.0 != range1.contains(element26)) throw AssertionError() + if (element26 !in 3.0 .. 1.0 != !range1.contains(element26)) throw AssertionError() + if (!(element26 in 3.0 .. 1.0) != !range1.contains(element26)) throw AssertionError() + if (!(element26 !in 3.0 .. 1.0) != range1.contains(element26)) throw AssertionError() +} + +fun testR1xE27() { + // with possible local optimizations + if (3.toLong() in 3.0 .. 1.0 != range1.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in 3.0 .. 1.0 != !range1.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in 3.0 .. 1.0) != !range1.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in 3.0 .. 1.0) != range1.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in 3.0 .. 1.0 != range1.contains(element27)) throw AssertionError() + if (element27 !in 3.0 .. 1.0 != !range1.contains(element27)) throw AssertionError() + if (!(element27 in 3.0 .. 1.0) != !range1.contains(element27)) throw AssertionError() + if (!(element27 !in 3.0 .. 1.0) != range1.contains(element27)) throw AssertionError() +} + +fun testR1xE28() { + // with possible local optimizations + if (3.toFloat() in 3.0 .. 1.0 != range1.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in 3.0 .. 1.0 != !range1.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in 3.0 .. 1.0) != !range1.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in 3.0 .. 1.0) != range1.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in 3.0 .. 1.0 != range1.contains(element28)) throw AssertionError() + if (element28 !in 3.0 .. 1.0 != !range1.contains(element28)) throw AssertionError() + if (!(element28 in 3.0 .. 1.0) != !range1.contains(element28)) throw AssertionError() + if (!(element28 !in 3.0 .. 1.0) != range1.contains(element28)) throw AssertionError() +} + +fun testR1xE29() { + // with possible local optimizations + if (3.toDouble() in 3.0 .. 1.0 != range1.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in 3.0 .. 1.0 != !range1.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in 3.0 .. 1.0) != !range1.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in 3.0 .. 1.0) != range1.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in 3.0 .. 1.0 != range1.contains(element29)) throw AssertionError() + if (element29 !in 3.0 .. 1.0 != !range1.contains(element29)) throw AssertionError() + if (!(element29 in 3.0 .. 1.0) != !range1.contains(element29)) throw AssertionError() + if (!(element29 !in 3.0 .. 1.0) != range1.contains(element29)) throw AssertionError() +} + +fun testR1xE30() { + // with possible local optimizations + if (4.toByte() in 3.0 .. 1.0 != range1.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 3.0 .. 1.0 != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 3.0 .. 1.0) != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 3.0 .. 1.0) != range1.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in 3.0 .. 1.0 != range1.contains(element30)) throw AssertionError() + if (element30 !in 3.0 .. 1.0 != !range1.contains(element30)) throw AssertionError() + if (!(element30 in 3.0 .. 1.0) != !range1.contains(element30)) throw AssertionError() + if (!(element30 !in 3.0 .. 1.0) != range1.contains(element30)) throw AssertionError() +} + +fun testR1xE31() { + // with possible local optimizations + if (4.toShort() in 3.0 .. 1.0 != range1.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 3.0 .. 1.0 != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 3.0 .. 1.0) != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 3.0 .. 1.0) != range1.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in 3.0 .. 1.0 != range1.contains(element31)) throw AssertionError() + if (element31 !in 3.0 .. 1.0 != !range1.contains(element31)) throw AssertionError() + if (!(element31 in 3.0 .. 1.0) != !range1.contains(element31)) throw AssertionError() + if (!(element31 !in 3.0 .. 1.0) != range1.contains(element31)) throw AssertionError() +} + +fun testR1xE32() { + // with possible local optimizations + if (4 in 3.0 .. 1.0 != range1.contains(4)) throw AssertionError() + if (4 !in 3.0 .. 1.0 != !range1.contains(4)) throw AssertionError() + if (!(4 in 3.0 .. 1.0) != !range1.contains(4)) throw AssertionError() + if (!(4 !in 3.0 .. 1.0) != range1.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in 3.0 .. 1.0 != range1.contains(element32)) throw AssertionError() + if (element32 !in 3.0 .. 1.0 != !range1.contains(element32)) throw AssertionError() + if (!(element32 in 3.0 .. 1.0) != !range1.contains(element32)) throw AssertionError() + if (!(element32 !in 3.0 .. 1.0) != range1.contains(element32)) throw AssertionError() +} + +fun testR1xE33() { + // with possible local optimizations + if (4.toLong() in 3.0 .. 1.0 != range1.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in 3.0 .. 1.0 != !range1.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in 3.0 .. 1.0) != !range1.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in 3.0 .. 1.0) != range1.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in 3.0 .. 1.0 != range1.contains(element33)) throw AssertionError() + if (element33 !in 3.0 .. 1.0 != !range1.contains(element33)) throw AssertionError() + if (!(element33 in 3.0 .. 1.0) != !range1.contains(element33)) throw AssertionError() + if (!(element33 !in 3.0 .. 1.0) != range1.contains(element33)) throw AssertionError() +} + +fun testR1xE34() { + // with possible local optimizations + if (4.toFloat() in 3.0 .. 1.0 != range1.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in 3.0 .. 1.0 != !range1.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in 3.0 .. 1.0) != !range1.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in 3.0 .. 1.0) != range1.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in 3.0 .. 1.0 != range1.contains(element34)) throw AssertionError() + if (element34 !in 3.0 .. 1.0 != !range1.contains(element34)) throw AssertionError() + if (!(element34 in 3.0 .. 1.0) != !range1.contains(element34)) throw AssertionError() + if (!(element34 !in 3.0 .. 1.0) != range1.contains(element34)) throw AssertionError() +} + +fun testR1xE35() { + // with possible local optimizations + if (4.toDouble() in 3.0 .. 1.0 != range1.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in 3.0 .. 1.0 != !range1.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in 3.0 .. 1.0) != !range1.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in 3.0 .. 1.0) != range1.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in 3.0 .. 1.0 != range1.contains(element35)) throw AssertionError() + if (element35 !in 3.0 .. 1.0 != !range1.contains(element35)) throw AssertionError() + if (!(element35 in 3.0 .. 1.0) != !range1.contains(element35)) throw AssertionError() + if (!(element35 !in 3.0 .. 1.0) != range1.contains(element35)) throw AssertionError() +} + + diff --git a/backend.native/tests/external/codegen/box/ranges/contains/generated/floatRangeLiteral.kt b/backend.native/tests/external/codegen/box/ranges/contains/generated/floatRangeLiteral.kt new file mode 100644 index 00000000000..9e098f9c705 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/generated/floatRangeLiteral.kt @@ -0,0 +1,1058 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_RUNTIME + + + +val range0 = 1.0F .. 3.0F +val range1 = 3.0F .. 1.0F + +val element0 = (-1).toByte() +val element1 = (-1).toShort() +val element2 = (-1) +val element3 = (-1).toLong() +val element4 = (-1).toFloat() +val element5 = (-1).toDouble() +val element6 = 0.toByte() +val element7 = 0.toShort() +val element8 = 0 +val element9 = 0.toLong() +val element10 = 0.toFloat() +val element11 = 0.toDouble() +val element12 = 1.toByte() +val element13 = 1.toShort() +val element14 = 1 +val element15 = 1.toLong() +val element16 = 1.toFloat() +val element17 = 1.toDouble() +val element18 = 2.toByte() +val element19 = 2.toShort() +val element20 = 2 +val element21 = 2.toLong() +val element22 = 2.toFloat() +val element23 = 2.toDouble() +val element24 = 3.toByte() +val element25 = 3.toShort() +val element26 = 3 +val element27 = 3.toLong() +val element28 = 3.toFloat() +val element29 = 3.toDouble() +val element30 = 4.toByte() +val element31 = 4.toShort() +val element32 = 4 +val element33 = 4.toLong() +val element34 = 4.toFloat() +val element35 = 4.toDouble() + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR0xE5() + testR0xE6() + testR0xE7() + testR0xE8() + testR0xE9() + testR0xE10() + testR0xE11() + testR0xE12() + testR0xE13() + testR0xE14() + testR0xE15() + testR0xE16() + testR0xE17() + testR0xE18() + testR0xE19() + testR0xE20() + testR0xE21() + testR0xE22() + testR0xE23() + testR0xE24() + testR0xE25() + testR0xE26() + testR0xE27() + testR0xE28() + testR0xE29() + testR0xE30() + testR0xE31() + testR0xE32() + testR0xE33() + testR0xE34() + testR0xE35() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + testR1xE5() + testR1xE6() + testR1xE7() + testR1xE8() + testR1xE9() + testR1xE10() + testR1xE11() + testR1xE12() + testR1xE13() + testR1xE14() + testR1xE15() + testR1xE16() + testR1xE17() + testR1xE18() + testR1xE19() + testR1xE20() + testR1xE21() + testR1xE22() + testR1xE23() + testR1xE24() + testR1xE25() + testR1xE26() + testR1xE27() + testR1xE28() + testR1xE29() + testR1xE30() + testR1xE31() + testR1xE32() + testR1xE33() + testR1xE34() + testR1xE35() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if ((-1).toByte() in 1.0F .. 3.0F != range0.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 1.0F .. 3.0F != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 1.0F .. 3.0F) != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 1.0F .. 3.0F) != range0.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 1.0F .. 3.0F != range0.contains(element0)) throw AssertionError() + if (element0 !in 1.0F .. 3.0F != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1.0F .. 3.0F) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1.0F .. 3.0F) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if ((-1).toShort() in 1.0F .. 3.0F != range0.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 1.0F .. 3.0F != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 1.0F .. 3.0F) != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 1.0F .. 3.0F) != range0.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 1.0F .. 3.0F != range0.contains(element1)) throw AssertionError() + if (element1 !in 1.0F .. 3.0F != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1.0F .. 3.0F) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1.0F .. 3.0F) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if ((-1) in 1.0F .. 3.0F != range0.contains((-1))) throw AssertionError() + if ((-1) !in 1.0F .. 3.0F != !range0.contains((-1))) throw AssertionError() + if (!((-1) in 1.0F .. 3.0F) != !range0.contains((-1))) throw AssertionError() + if (!((-1) !in 1.0F .. 3.0F) != range0.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in 1.0F .. 3.0F != range0.contains(element2)) throw AssertionError() + if (element2 !in 1.0F .. 3.0F != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1.0F .. 3.0F) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1.0F .. 3.0F) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if ((-1).toLong() in 1.0F .. 3.0F != range0.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in 1.0F .. 3.0F != !range0.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in 1.0F .. 3.0F) != !range0.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in 1.0F .. 3.0F) != range0.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in 1.0F .. 3.0F != range0.contains(element3)) throw AssertionError() + if (element3 !in 1.0F .. 3.0F != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1.0F .. 3.0F) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1.0F .. 3.0F) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if ((-1).toFloat() in 1.0F .. 3.0F != range0.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in 1.0F .. 3.0F != !range0.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in 1.0F .. 3.0F) != !range0.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in 1.0F .. 3.0F) != range0.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in 1.0F .. 3.0F != range0.contains(element4)) throw AssertionError() + if (element4 !in 1.0F .. 3.0F != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1.0F .. 3.0F) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1.0F .. 3.0F) != range0.contains(element4)) throw AssertionError() +} + +fun testR0xE5() { + // with possible local optimizations + if ((-1).toDouble() in 1.0F .. 3.0F != range0.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in 1.0F .. 3.0F != !range0.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in 1.0F .. 3.0F) != !range0.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in 1.0F .. 3.0F) != range0.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in 1.0F .. 3.0F != range0.contains(element5)) throw AssertionError() + if (element5 !in 1.0F .. 3.0F != !range0.contains(element5)) throw AssertionError() + if (!(element5 in 1.0F .. 3.0F) != !range0.contains(element5)) throw AssertionError() + if (!(element5 !in 1.0F .. 3.0F) != range0.contains(element5)) throw AssertionError() +} + +fun testR0xE6() { + // with possible local optimizations + if (0.toByte() in 1.0F .. 3.0F != range0.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 1.0F .. 3.0F != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 1.0F .. 3.0F) != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 1.0F .. 3.0F) != range0.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in 1.0F .. 3.0F != range0.contains(element6)) throw AssertionError() + if (element6 !in 1.0F .. 3.0F != !range0.contains(element6)) throw AssertionError() + if (!(element6 in 1.0F .. 3.0F) != !range0.contains(element6)) throw AssertionError() + if (!(element6 !in 1.0F .. 3.0F) != range0.contains(element6)) throw AssertionError() +} + +fun testR0xE7() { + // with possible local optimizations + if (0.toShort() in 1.0F .. 3.0F != range0.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 1.0F .. 3.0F != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 1.0F .. 3.0F) != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 1.0F .. 3.0F) != range0.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in 1.0F .. 3.0F != range0.contains(element7)) throw AssertionError() + if (element7 !in 1.0F .. 3.0F != !range0.contains(element7)) throw AssertionError() + if (!(element7 in 1.0F .. 3.0F) != !range0.contains(element7)) throw AssertionError() + if (!(element7 !in 1.0F .. 3.0F) != range0.contains(element7)) throw AssertionError() +} + +fun testR0xE8() { + // with possible local optimizations + if (0 in 1.0F .. 3.0F != range0.contains(0)) throw AssertionError() + if (0 !in 1.0F .. 3.0F != !range0.contains(0)) throw AssertionError() + if (!(0 in 1.0F .. 3.0F) != !range0.contains(0)) throw AssertionError() + if (!(0 !in 1.0F .. 3.0F) != range0.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in 1.0F .. 3.0F != range0.contains(element8)) throw AssertionError() + if (element8 !in 1.0F .. 3.0F != !range0.contains(element8)) throw AssertionError() + if (!(element8 in 1.0F .. 3.0F) != !range0.contains(element8)) throw AssertionError() + if (!(element8 !in 1.0F .. 3.0F) != range0.contains(element8)) throw AssertionError() +} + +fun testR0xE9() { + // with possible local optimizations + if (0.toLong() in 1.0F .. 3.0F != range0.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in 1.0F .. 3.0F != !range0.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in 1.0F .. 3.0F) != !range0.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in 1.0F .. 3.0F) != range0.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in 1.0F .. 3.0F != range0.contains(element9)) throw AssertionError() + if (element9 !in 1.0F .. 3.0F != !range0.contains(element9)) throw AssertionError() + if (!(element9 in 1.0F .. 3.0F) != !range0.contains(element9)) throw AssertionError() + if (!(element9 !in 1.0F .. 3.0F) != range0.contains(element9)) throw AssertionError() +} + +fun testR0xE10() { + // with possible local optimizations + if (0.toFloat() in 1.0F .. 3.0F != range0.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in 1.0F .. 3.0F != !range0.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in 1.0F .. 3.0F) != !range0.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in 1.0F .. 3.0F) != range0.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in 1.0F .. 3.0F != range0.contains(element10)) throw AssertionError() + if (element10 !in 1.0F .. 3.0F != !range0.contains(element10)) throw AssertionError() + if (!(element10 in 1.0F .. 3.0F) != !range0.contains(element10)) throw AssertionError() + if (!(element10 !in 1.0F .. 3.0F) != range0.contains(element10)) throw AssertionError() +} + +fun testR0xE11() { + // with possible local optimizations + if (0.toDouble() in 1.0F .. 3.0F != range0.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in 1.0F .. 3.0F != !range0.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in 1.0F .. 3.0F) != !range0.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in 1.0F .. 3.0F) != range0.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in 1.0F .. 3.0F != range0.contains(element11)) throw AssertionError() + if (element11 !in 1.0F .. 3.0F != !range0.contains(element11)) throw AssertionError() + if (!(element11 in 1.0F .. 3.0F) != !range0.contains(element11)) throw AssertionError() + if (!(element11 !in 1.0F .. 3.0F) != range0.contains(element11)) throw AssertionError() +} + +fun testR0xE12() { + // with possible local optimizations + if (1.toByte() in 1.0F .. 3.0F != range0.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 1.0F .. 3.0F != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 1.0F .. 3.0F) != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 1.0F .. 3.0F) != range0.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 1.0F .. 3.0F != range0.contains(element12)) throw AssertionError() + if (element12 !in 1.0F .. 3.0F != !range0.contains(element12)) throw AssertionError() + if (!(element12 in 1.0F .. 3.0F) != !range0.contains(element12)) throw AssertionError() + if (!(element12 !in 1.0F .. 3.0F) != range0.contains(element12)) throw AssertionError() +} + +fun testR0xE13() { + // with possible local optimizations + if (1.toShort() in 1.0F .. 3.0F != range0.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 1.0F .. 3.0F != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 1.0F .. 3.0F) != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 1.0F .. 3.0F) != range0.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 1.0F .. 3.0F != range0.contains(element13)) throw AssertionError() + if (element13 !in 1.0F .. 3.0F != !range0.contains(element13)) throw AssertionError() + if (!(element13 in 1.0F .. 3.0F) != !range0.contains(element13)) throw AssertionError() + if (!(element13 !in 1.0F .. 3.0F) != range0.contains(element13)) throw AssertionError() +} + +fun testR0xE14() { + // with possible local optimizations + if (1 in 1.0F .. 3.0F != range0.contains(1)) throw AssertionError() + if (1 !in 1.0F .. 3.0F != !range0.contains(1)) throw AssertionError() + if (!(1 in 1.0F .. 3.0F) != !range0.contains(1)) throw AssertionError() + if (!(1 !in 1.0F .. 3.0F) != range0.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in 1.0F .. 3.0F != range0.contains(element14)) throw AssertionError() + if (element14 !in 1.0F .. 3.0F != !range0.contains(element14)) throw AssertionError() + if (!(element14 in 1.0F .. 3.0F) != !range0.contains(element14)) throw AssertionError() + if (!(element14 !in 1.0F .. 3.0F) != range0.contains(element14)) throw AssertionError() +} + +fun testR0xE15() { + // with possible local optimizations + if (1.toLong() in 1.0F .. 3.0F != range0.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in 1.0F .. 3.0F != !range0.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in 1.0F .. 3.0F) != !range0.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in 1.0F .. 3.0F) != range0.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in 1.0F .. 3.0F != range0.contains(element15)) throw AssertionError() + if (element15 !in 1.0F .. 3.0F != !range0.contains(element15)) throw AssertionError() + if (!(element15 in 1.0F .. 3.0F) != !range0.contains(element15)) throw AssertionError() + if (!(element15 !in 1.0F .. 3.0F) != range0.contains(element15)) throw AssertionError() +} + +fun testR0xE16() { + // with possible local optimizations + if (1.toFloat() in 1.0F .. 3.0F != range0.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in 1.0F .. 3.0F != !range0.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in 1.0F .. 3.0F) != !range0.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in 1.0F .. 3.0F) != range0.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in 1.0F .. 3.0F != range0.contains(element16)) throw AssertionError() + if (element16 !in 1.0F .. 3.0F != !range0.contains(element16)) throw AssertionError() + if (!(element16 in 1.0F .. 3.0F) != !range0.contains(element16)) throw AssertionError() + if (!(element16 !in 1.0F .. 3.0F) != range0.contains(element16)) throw AssertionError() +} + +fun testR0xE17() { + // with possible local optimizations + if (1.toDouble() in 1.0F .. 3.0F != range0.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in 1.0F .. 3.0F != !range0.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in 1.0F .. 3.0F) != !range0.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in 1.0F .. 3.0F) != range0.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in 1.0F .. 3.0F != range0.contains(element17)) throw AssertionError() + if (element17 !in 1.0F .. 3.0F != !range0.contains(element17)) throw AssertionError() + if (!(element17 in 1.0F .. 3.0F) != !range0.contains(element17)) throw AssertionError() + if (!(element17 !in 1.0F .. 3.0F) != range0.contains(element17)) throw AssertionError() +} + +fun testR0xE18() { + // with possible local optimizations + if (2.toByte() in 1.0F .. 3.0F != range0.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 1.0F .. 3.0F != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 1.0F .. 3.0F) != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 1.0F .. 3.0F) != range0.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in 1.0F .. 3.0F != range0.contains(element18)) throw AssertionError() + if (element18 !in 1.0F .. 3.0F != !range0.contains(element18)) throw AssertionError() + if (!(element18 in 1.0F .. 3.0F) != !range0.contains(element18)) throw AssertionError() + if (!(element18 !in 1.0F .. 3.0F) != range0.contains(element18)) throw AssertionError() +} + +fun testR0xE19() { + // with possible local optimizations + if (2.toShort() in 1.0F .. 3.0F != range0.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 1.0F .. 3.0F != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 1.0F .. 3.0F) != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 1.0F .. 3.0F) != range0.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in 1.0F .. 3.0F != range0.contains(element19)) throw AssertionError() + if (element19 !in 1.0F .. 3.0F != !range0.contains(element19)) throw AssertionError() + if (!(element19 in 1.0F .. 3.0F) != !range0.contains(element19)) throw AssertionError() + if (!(element19 !in 1.0F .. 3.0F) != range0.contains(element19)) throw AssertionError() +} + +fun testR0xE20() { + // with possible local optimizations + if (2 in 1.0F .. 3.0F != range0.contains(2)) throw AssertionError() + if (2 !in 1.0F .. 3.0F != !range0.contains(2)) throw AssertionError() + if (!(2 in 1.0F .. 3.0F) != !range0.contains(2)) throw AssertionError() + if (!(2 !in 1.0F .. 3.0F) != range0.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in 1.0F .. 3.0F != range0.contains(element20)) throw AssertionError() + if (element20 !in 1.0F .. 3.0F != !range0.contains(element20)) throw AssertionError() + if (!(element20 in 1.0F .. 3.0F) != !range0.contains(element20)) throw AssertionError() + if (!(element20 !in 1.0F .. 3.0F) != range0.contains(element20)) throw AssertionError() +} + +fun testR0xE21() { + // with possible local optimizations + if (2.toLong() in 1.0F .. 3.0F != range0.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in 1.0F .. 3.0F != !range0.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in 1.0F .. 3.0F) != !range0.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in 1.0F .. 3.0F) != range0.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in 1.0F .. 3.0F != range0.contains(element21)) throw AssertionError() + if (element21 !in 1.0F .. 3.0F != !range0.contains(element21)) throw AssertionError() + if (!(element21 in 1.0F .. 3.0F) != !range0.contains(element21)) throw AssertionError() + if (!(element21 !in 1.0F .. 3.0F) != range0.contains(element21)) throw AssertionError() +} + +fun testR0xE22() { + // with possible local optimizations + if (2.toFloat() in 1.0F .. 3.0F != range0.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in 1.0F .. 3.0F != !range0.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in 1.0F .. 3.0F) != !range0.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in 1.0F .. 3.0F) != range0.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in 1.0F .. 3.0F != range0.contains(element22)) throw AssertionError() + if (element22 !in 1.0F .. 3.0F != !range0.contains(element22)) throw AssertionError() + if (!(element22 in 1.0F .. 3.0F) != !range0.contains(element22)) throw AssertionError() + if (!(element22 !in 1.0F .. 3.0F) != range0.contains(element22)) throw AssertionError() +} + +fun testR0xE23() { + // with possible local optimizations + if (2.toDouble() in 1.0F .. 3.0F != range0.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in 1.0F .. 3.0F != !range0.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in 1.0F .. 3.0F) != !range0.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in 1.0F .. 3.0F) != range0.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in 1.0F .. 3.0F != range0.contains(element23)) throw AssertionError() + if (element23 !in 1.0F .. 3.0F != !range0.contains(element23)) throw AssertionError() + if (!(element23 in 1.0F .. 3.0F) != !range0.contains(element23)) throw AssertionError() + if (!(element23 !in 1.0F .. 3.0F) != range0.contains(element23)) throw AssertionError() +} + +fun testR0xE24() { + // with possible local optimizations + if (3.toByte() in 1.0F .. 3.0F != range0.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 1.0F .. 3.0F != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 1.0F .. 3.0F) != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 1.0F .. 3.0F) != range0.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in 1.0F .. 3.0F != range0.contains(element24)) throw AssertionError() + if (element24 !in 1.0F .. 3.0F != !range0.contains(element24)) throw AssertionError() + if (!(element24 in 1.0F .. 3.0F) != !range0.contains(element24)) throw AssertionError() + if (!(element24 !in 1.0F .. 3.0F) != range0.contains(element24)) throw AssertionError() +} + +fun testR0xE25() { + // with possible local optimizations + if (3.toShort() in 1.0F .. 3.0F != range0.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 1.0F .. 3.0F != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 1.0F .. 3.0F) != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 1.0F .. 3.0F) != range0.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in 1.0F .. 3.0F != range0.contains(element25)) throw AssertionError() + if (element25 !in 1.0F .. 3.0F != !range0.contains(element25)) throw AssertionError() + if (!(element25 in 1.0F .. 3.0F) != !range0.contains(element25)) throw AssertionError() + if (!(element25 !in 1.0F .. 3.0F) != range0.contains(element25)) throw AssertionError() +} + +fun testR0xE26() { + // with possible local optimizations + if (3 in 1.0F .. 3.0F != range0.contains(3)) throw AssertionError() + if (3 !in 1.0F .. 3.0F != !range0.contains(3)) throw AssertionError() + if (!(3 in 1.0F .. 3.0F) != !range0.contains(3)) throw AssertionError() + if (!(3 !in 1.0F .. 3.0F) != range0.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in 1.0F .. 3.0F != range0.contains(element26)) throw AssertionError() + if (element26 !in 1.0F .. 3.0F != !range0.contains(element26)) throw AssertionError() + if (!(element26 in 1.0F .. 3.0F) != !range0.contains(element26)) throw AssertionError() + if (!(element26 !in 1.0F .. 3.0F) != range0.contains(element26)) throw AssertionError() +} + +fun testR0xE27() { + // with possible local optimizations + if (3.toLong() in 1.0F .. 3.0F != range0.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in 1.0F .. 3.0F != !range0.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in 1.0F .. 3.0F) != !range0.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in 1.0F .. 3.0F) != range0.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in 1.0F .. 3.0F != range0.contains(element27)) throw AssertionError() + if (element27 !in 1.0F .. 3.0F != !range0.contains(element27)) throw AssertionError() + if (!(element27 in 1.0F .. 3.0F) != !range0.contains(element27)) throw AssertionError() + if (!(element27 !in 1.0F .. 3.0F) != range0.contains(element27)) throw AssertionError() +} + +fun testR0xE28() { + // with possible local optimizations + if (3.toFloat() in 1.0F .. 3.0F != range0.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in 1.0F .. 3.0F != !range0.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in 1.0F .. 3.0F) != !range0.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in 1.0F .. 3.0F) != range0.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in 1.0F .. 3.0F != range0.contains(element28)) throw AssertionError() + if (element28 !in 1.0F .. 3.0F != !range0.contains(element28)) throw AssertionError() + if (!(element28 in 1.0F .. 3.0F) != !range0.contains(element28)) throw AssertionError() + if (!(element28 !in 1.0F .. 3.0F) != range0.contains(element28)) throw AssertionError() +} + +fun testR0xE29() { + // with possible local optimizations + if (3.toDouble() in 1.0F .. 3.0F != range0.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in 1.0F .. 3.0F != !range0.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in 1.0F .. 3.0F) != !range0.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in 1.0F .. 3.0F) != range0.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in 1.0F .. 3.0F != range0.contains(element29)) throw AssertionError() + if (element29 !in 1.0F .. 3.0F != !range0.contains(element29)) throw AssertionError() + if (!(element29 in 1.0F .. 3.0F) != !range0.contains(element29)) throw AssertionError() + if (!(element29 !in 1.0F .. 3.0F) != range0.contains(element29)) throw AssertionError() +} + +fun testR0xE30() { + // with possible local optimizations + if (4.toByte() in 1.0F .. 3.0F != range0.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 1.0F .. 3.0F != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 1.0F .. 3.0F) != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 1.0F .. 3.0F) != range0.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in 1.0F .. 3.0F != range0.contains(element30)) throw AssertionError() + if (element30 !in 1.0F .. 3.0F != !range0.contains(element30)) throw AssertionError() + if (!(element30 in 1.0F .. 3.0F) != !range0.contains(element30)) throw AssertionError() + if (!(element30 !in 1.0F .. 3.0F) != range0.contains(element30)) throw AssertionError() +} + +fun testR0xE31() { + // with possible local optimizations + if (4.toShort() in 1.0F .. 3.0F != range0.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 1.0F .. 3.0F != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 1.0F .. 3.0F) != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 1.0F .. 3.0F) != range0.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in 1.0F .. 3.0F != range0.contains(element31)) throw AssertionError() + if (element31 !in 1.0F .. 3.0F != !range0.contains(element31)) throw AssertionError() + if (!(element31 in 1.0F .. 3.0F) != !range0.contains(element31)) throw AssertionError() + if (!(element31 !in 1.0F .. 3.0F) != range0.contains(element31)) throw AssertionError() +} + +fun testR0xE32() { + // with possible local optimizations + if (4 in 1.0F .. 3.0F != range0.contains(4)) throw AssertionError() + if (4 !in 1.0F .. 3.0F != !range0.contains(4)) throw AssertionError() + if (!(4 in 1.0F .. 3.0F) != !range0.contains(4)) throw AssertionError() + if (!(4 !in 1.0F .. 3.0F) != range0.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in 1.0F .. 3.0F != range0.contains(element32)) throw AssertionError() + if (element32 !in 1.0F .. 3.0F != !range0.contains(element32)) throw AssertionError() + if (!(element32 in 1.0F .. 3.0F) != !range0.contains(element32)) throw AssertionError() + if (!(element32 !in 1.0F .. 3.0F) != range0.contains(element32)) throw AssertionError() +} + +fun testR0xE33() { + // with possible local optimizations + if (4.toLong() in 1.0F .. 3.0F != range0.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in 1.0F .. 3.0F != !range0.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in 1.0F .. 3.0F) != !range0.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in 1.0F .. 3.0F) != range0.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in 1.0F .. 3.0F != range0.contains(element33)) throw AssertionError() + if (element33 !in 1.0F .. 3.0F != !range0.contains(element33)) throw AssertionError() + if (!(element33 in 1.0F .. 3.0F) != !range0.contains(element33)) throw AssertionError() + if (!(element33 !in 1.0F .. 3.0F) != range0.contains(element33)) throw AssertionError() +} + +fun testR0xE34() { + // with possible local optimizations + if (4.toFloat() in 1.0F .. 3.0F != range0.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in 1.0F .. 3.0F != !range0.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in 1.0F .. 3.0F) != !range0.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in 1.0F .. 3.0F) != range0.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in 1.0F .. 3.0F != range0.contains(element34)) throw AssertionError() + if (element34 !in 1.0F .. 3.0F != !range0.contains(element34)) throw AssertionError() + if (!(element34 in 1.0F .. 3.0F) != !range0.contains(element34)) throw AssertionError() + if (!(element34 !in 1.0F .. 3.0F) != range0.contains(element34)) throw AssertionError() +} + +fun testR0xE35() { + // with possible local optimizations + if (4.toDouble() in 1.0F .. 3.0F != range0.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in 1.0F .. 3.0F != !range0.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in 1.0F .. 3.0F) != !range0.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in 1.0F .. 3.0F) != range0.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in 1.0F .. 3.0F != range0.contains(element35)) throw AssertionError() + if (element35 !in 1.0F .. 3.0F != !range0.contains(element35)) throw AssertionError() + if (!(element35 in 1.0F .. 3.0F) != !range0.contains(element35)) throw AssertionError() + if (!(element35 !in 1.0F .. 3.0F) != range0.contains(element35)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if ((-1).toByte() in 3.0F .. 1.0F != range1.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 3.0F .. 1.0F != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 3.0F .. 1.0F) != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 3.0F .. 1.0F) != range1.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 3.0F .. 1.0F != range1.contains(element0)) throw AssertionError() + if (element0 !in 3.0F .. 1.0F != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3.0F .. 1.0F) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3.0F .. 1.0F) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if ((-1).toShort() in 3.0F .. 1.0F != range1.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 3.0F .. 1.0F != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 3.0F .. 1.0F) != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 3.0F .. 1.0F) != range1.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 3.0F .. 1.0F != range1.contains(element1)) throw AssertionError() + if (element1 !in 3.0F .. 1.0F != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3.0F .. 1.0F) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3.0F .. 1.0F) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if ((-1) in 3.0F .. 1.0F != range1.contains((-1))) throw AssertionError() + if ((-1) !in 3.0F .. 1.0F != !range1.contains((-1))) throw AssertionError() + if (!((-1) in 3.0F .. 1.0F) != !range1.contains((-1))) throw AssertionError() + if (!((-1) !in 3.0F .. 1.0F) != range1.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in 3.0F .. 1.0F != range1.contains(element2)) throw AssertionError() + if (element2 !in 3.0F .. 1.0F != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3.0F .. 1.0F) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3.0F .. 1.0F) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if ((-1).toLong() in 3.0F .. 1.0F != range1.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in 3.0F .. 1.0F != !range1.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in 3.0F .. 1.0F) != !range1.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in 3.0F .. 1.0F) != range1.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in 3.0F .. 1.0F != range1.contains(element3)) throw AssertionError() + if (element3 !in 3.0F .. 1.0F != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3.0F .. 1.0F) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3.0F .. 1.0F) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if ((-1).toFloat() in 3.0F .. 1.0F != range1.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in 3.0F .. 1.0F != !range1.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in 3.0F .. 1.0F) != !range1.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in 3.0F .. 1.0F) != range1.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in 3.0F .. 1.0F != range1.contains(element4)) throw AssertionError() + if (element4 !in 3.0F .. 1.0F != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3.0F .. 1.0F) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3.0F .. 1.0F) != range1.contains(element4)) throw AssertionError() +} + +fun testR1xE5() { + // with possible local optimizations + if ((-1).toDouble() in 3.0F .. 1.0F != range1.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in 3.0F .. 1.0F != !range1.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in 3.0F .. 1.0F) != !range1.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in 3.0F .. 1.0F) != range1.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in 3.0F .. 1.0F != range1.contains(element5)) throw AssertionError() + if (element5 !in 3.0F .. 1.0F != !range1.contains(element5)) throw AssertionError() + if (!(element5 in 3.0F .. 1.0F) != !range1.contains(element5)) throw AssertionError() + if (!(element5 !in 3.0F .. 1.0F) != range1.contains(element5)) throw AssertionError() +} + +fun testR1xE6() { + // with possible local optimizations + if (0.toByte() in 3.0F .. 1.0F != range1.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 3.0F .. 1.0F != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 3.0F .. 1.0F) != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 3.0F .. 1.0F) != range1.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in 3.0F .. 1.0F != range1.contains(element6)) throw AssertionError() + if (element6 !in 3.0F .. 1.0F != !range1.contains(element6)) throw AssertionError() + if (!(element6 in 3.0F .. 1.0F) != !range1.contains(element6)) throw AssertionError() + if (!(element6 !in 3.0F .. 1.0F) != range1.contains(element6)) throw AssertionError() +} + +fun testR1xE7() { + // with possible local optimizations + if (0.toShort() in 3.0F .. 1.0F != range1.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 3.0F .. 1.0F != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 3.0F .. 1.0F) != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 3.0F .. 1.0F) != range1.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in 3.0F .. 1.0F != range1.contains(element7)) throw AssertionError() + if (element7 !in 3.0F .. 1.0F != !range1.contains(element7)) throw AssertionError() + if (!(element7 in 3.0F .. 1.0F) != !range1.contains(element7)) throw AssertionError() + if (!(element7 !in 3.0F .. 1.0F) != range1.contains(element7)) throw AssertionError() +} + +fun testR1xE8() { + // with possible local optimizations + if (0 in 3.0F .. 1.0F != range1.contains(0)) throw AssertionError() + if (0 !in 3.0F .. 1.0F != !range1.contains(0)) throw AssertionError() + if (!(0 in 3.0F .. 1.0F) != !range1.contains(0)) throw AssertionError() + if (!(0 !in 3.0F .. 1.0F) != range1.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in 3.0F .. 1.0F != range1.contains(element8)) throw AssertionError() + if (element8 !in 3.0F .. 1.0F != !range1.contains(element8)) throw AssertionError() + if (!(element8 in 3.0F .. 1.0F) != !range1.contains(element8)) throw AssertionError() + if (!(element8 !in 3.0F .. 1.0F) != range1.contains(element8)) throw AssertionError() +} + +fun testR1xE9() { + // with possible local optimizations + if (0.toLong() in 3.0F .. 1.0F != range1.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in 3.0F .. 1.0F != !range1.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in 3.0F .. 1.0F) != !range1.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in 3.0F .. 1.0F) != range1.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in 3.0F .. 1.0F != range1.contains(element9)) throw AssertionError() + if (element9 !in 3.0F .. 1.0F != !range1.contains(element9)) throw AssertionError() + if (!(element9 in 3.0F .. 1.0F) != !range1.contains(element9)) throw AssertionError() + if (!(element9 !in 3.0F .. 1.0F) != range1.contains(element9)) throw AssertionError() +} + +fun testR1xE10() { + // with possible local optimizations + if (0.toFloat() in 3.0F .. 1.0F != range1.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in 3.0F .. 1.0F != !range1.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in 3.0F .. 1.0F) != !range1.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in 3.0F .. 1.0F) != range1.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in 3.0F .. 1.0F != range1.contains(element10)) throw AssertionError() + if (element10 !in 3.0F .. 1.0F != !range1.contains(element10)) throw AssertionError() + if (!(element10 in 3.0F .. 1.0F) != !range1.contains(element10)) throw AssertionError() + if (!(element10 !in 3.0F .. 1.0F) != range1.contains(element10)) throw AssertionError() +} + +fun testR1xE11() { + // with possible local optimizations + if (0.toDouble() in 3.0F .. 1.0F != range1.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in 3.0F .. 1.0F != !range1.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in 3.0F .. 1.0F) != !range1.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in 3.0F .. 1.0F) != range1.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in 3.0F .. 1.0F != range1.contains(element11)) throw AssertionError() + if (element11 !in 3.0F .. 1.0F != !range1.contains(element11)) throw AssertionError() + if (!(element11 in 3.0F .. 1.0F) != !range1.contains(element11)) throw AssertionError() + if (!(element11 !in 3.0F .. 1.0F) != range1.contains(element11)) throw AssertionError() +} + +fun testR1xE12() { + // with possible local optimizations + if (1.toByte() in 3.0F .. 1.0F != range1.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 3.0F .. 1.0F != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 3.0F .. 1.0F) != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 3.0F .. 1.0F) != range1.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 3.0F .. 1.0F != range1.contains(element12)) throw AssertionError() + if (element12 !in 3.0F .. 1.0F != !range1.contains(element12)) throw AssertionError() + if (!(element12 in 3.0F .. 1.0F) != !range1.contains(element12)) throw AssertionError() + if (!(element12 !in 3.0F .. 1.0F) != range1.contains(element12)) throw AssertionError() +} + +fun testR1xE13() { + // with possible local optimizations + if (1.toShort() in 3.0F .. 1.0F != range1.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 3.0F .. 1.0F != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 3.0F .. 1.0F) != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 3.0F .. 1.0F) != range1.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 3.0F .. 1.0F != range1.contains(element13)) throw AssertionError() + if (element13 !in 3.0F .. 1.0F != !range1.contains(element13)) throw AssertionError() + if (!(element13 in 3.0F .. 1.0F) != !range1.contains(element13)) throw AssertionError() + if (!(element13 !in 3.0F .. 1.0F) != range1.contains(element13)) throw AssertionError() +} + +fun testR1xE14() { + // with possible local optimizations + if (1 in 3.0F .. 1.0F != range1.contains(1)) throw AssertionError() + if (1 !in 3.0F .. 1.0F != !range1.contains(1)) throw AssertionError() + if (!(1 in 3.0F .. 1.0F) != !range1.contains(1)) throw AssertionError() + if (!(1 !in 3.0F .. 1.0F) != range1.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in 3.0F .. 1.0F != range1.contains(element14)) throw AssertionError() + if (element14 !in 3.0F .. 1.0F != !range1.contains(element14)) throw AssertionError() + if (!(element14 in 3.0F .. 1.0F) != !range1.contains(element14)) throw AssertionError() + if (!(element14 !in 3.0F .. 1.0F) != range1.contains(element14)) throw AssertionError() +} + +fun testR1xE15() { + // with possible local optimizations + if (1.toLong() in 3.0F .. 1.0F != range1.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in 3.0F .. 1.0F != !range1.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in 3.0F .. 1.0F) != !range1.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in 3.0F .. 1.0F) != range1.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in 3.0F .. 1.0F != range1.contains(element15)) throw AssertionError() + if (element15 !in 3.0F .. 1.0F != !range1.contains(element15)) throw AssertionError() + if (!(element15 in 3.0F .. 1.0F) != !range1.contains(element15)) throw AssertionError() + if (!(element15 !in 3.0F .. 1.0F) != range1.contains(element15)) throw AssertionError() +} + +fun testR1xE16() { + // with possible local optimizations + if (1.toFloat() in 3.0F .. 1.0F != range1.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in 3.0F .. 1.0F != !range1.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in 3.0F .. 1.0F) != !range1.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in 3.0F .. 1.0F) != range1.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in 3.0F .. 1.0F != range1.contains(element16)) throw AssertionError() + if (element16 !in 3.0F .. 1.0F != !range1.contains(element16)) throw AssertionError() + if (!(element16 in 3.0F .. 1.0F) != !range1.contains(element16)) throw AssertionError() + if (!(element16 !in 3.0F .. 1.0F) != range1.contains(element16)) throw AssertionError() +} + +fun testR1xE17() { + // with possible local optimizations + if (1.toDouble() in 3.0F .. 1.0F != range1.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in 3.0F .. 1.0F != !range1.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in 3.0F .. 1.0F) != !range1.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in 3.0F .. 1.0F) != range1.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in 3.0F .. 1.0F != range1.contains(element17)) throw AssertionError() + if (element17 !in 3.0F .. 1.0F != !range1.contains(element17)) throw AssertionError() + if (!(element17 in 3.0F .. 1.0F) != !range1.contains(element17)) throw AssertionError() + if (!(element17 !in 3.0F .. 1.0F) != range1.contains(element17)) throw AssertionError() +} + +fun testR1xE18() { + // with possible local optimizations + if (2.toByte() in 3.0F .. 1.0F != range1.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 3.0F .. 1.0F != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 3.0F .. 1.0F) != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 3.0F .. 1.0F) != range1.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in 3.0F .. 1.0F != range1.contains(element18)) throw AssertionError() + if (element18 !in 3.0F .. 1.0F != !range1.contains(element18)) throw AssertionError() + if (!(element18 in 3.0F .. 1.0F) != !range1.contains(element18)) throw AssertionError() + if (!(element18 !in 3.0F .. 1.0F) != range1.contains(element18)) throw AssertionError() +} + +fun testR1xE19() { + // with possible local optimizations + if (2.toShort() in 3.0F .. 1.0F != range1.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 3.0F .. 1.0F != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 3.0F .. 1.0F) != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 3.0F .. 1.0F) != range1.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in 3.0F .. 1.0F != range1.contains(element19)) throw AssertionError() + if (element19 !in 3.0F .. 1.0F != !range1.contains(element19)) throw AssertionError() + if (!(element19 in 3.0F .. 1.0F) != !range1.contains(element19)) throw AssertionError() + if (!(element19 !in 3.0F .. 1.0F) != range1.contains(element19)) throw AssertionError() +} + +fun testR1xE20() { + // with possible local optimizations + if (2 in 3.0F .. 1.0F != range1.contains(2)) throw AssertionError() + if (2 !in 3.0F .. 1.0F != !range1.contains(2)) throw AssertionError() + if (!(2 in 3.0F .. 1.0F) != !range1.contains(2)) throw AssertionError() + if (!(2 !in 3.0F .. 1.0F) != range1.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in 3.0F .. 1.0F != range1.contains(element20)) throw AssertionError() + if (element20 !in 3.0F .. 1.0F != !range1.contains(element20)) throw AssertionError() + if (!(element20 in 3.0F .. 1.0F) != !range1.contains(element20)) throw AssertionError() + if (!(element20 !in 3.0F .. 1.0F) != range1.contains(element20)) throw AssertionError() +} + +fun testR1xE21() { + // with possible local optimizations + if (2.toLong() in 3.0F .. 1.0F != range1.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in 3.0F .. 1.0F != !range1.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in 3.0F .. 1.0F) != !range1.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in 3.0F .. 1.0F) != range1.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in 3.0F .. 1.0F != range1.contains(element21)) throw AssertionError() + if (element21 !in 3.0F .. 1.0F != !range1.contains(element21)) throw AssertionError() + if (!(element21 in 3.0F .. 1.0F) != !range1.contains(element21)) throw AssertionError() + if (!(element21 !in 3.0F .. 1.0F) != range1.contains(element21)) throw AssertionError() +} + +fun testR1xE22() { + // with possible local optimizations + if (2.toFloat() in 3.0F .. 1.0F != range1.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in 3.0F .. 1.0F != !range1.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in 3.0F .. 1.0F) != !range1.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in 3.0F .. 1.0F) != range1.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in 3.0F .. 1.0F != range1.contains(element22)) throw AssertionError() + if (element22 !in 3.0F .. 1.0F != !range1.contains(element22)) throw AssertionError() + if (!(element22 in 3.0F .. 1.0F) != !range1.contains(element22)) throw AssertionError() + if (!(element22 !in 3.0F .. 1.0F) != range1.contains(element22)) throw AssertionError() +} + +fun testR1xE23() { + // with possible local optimizations + if (2.toDouble() in 3.0F .. 1.0F != range1.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in 3.0F .. 1.0F != !range1.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in 3.0F .. 1.0F) != !range1.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in 3.0F .. 1.0F) != range1.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in 3.0F .. 1.0F != range1.contains(element23)) throw AssertionError() + if (element23 !in 3.0F .. 1.0F != !range1.contains(element23)) throw AssertionError() + if (!(element23 in 3.0F .. 1.0F) != !range1.contains(element23)) throw AssertionError() + if (!(element23 !in 3.0F .. 1.0F) != range1.contains(element23)) throw AssertionError() +} + +fun testR1xE24() { + // with possible local optimizations + if (3.toByte() in 3.0F .. 1.0F != range1.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 3.0F .. 1.0F != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 3.0F .. 1.0F) != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 3.0F .. 1.0F) != range1.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in 3.0F .. 1.0F != range1.contains(element24)) throw AssertionError() + if (element24 !in 3.0F .. 1.0F != !range1.contains(element24)) throw AssertionError() + if (!(element24 in 3.0F .. 1.0F) != !range1.contains(element24)) throw AssertionError() + if (!(element24 !in 3.0F .. 1.0F) != range1.contains(element24)) throw AssertionError() +} + +fun testR1xE25() { + // with possible local optimizations + if (3.toShort() in 3.0F .. 1.0F != range1.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 3.0F .. 1.0F != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 3.0F .. 1.0F) != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 3.0F .. 1.0F) != range1.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in 3.0F .. 1.0F != range1.contains(element25)) throw AssertionError() + if (element25 !in 3.0F .. 1.0F != !range1.contains(element25)) throw AssertionError() + if (!(element25 in 3.0F .. 1.0F) != !range1.contains(element25)) throw AssertionError() + if (!(element25 !in 3.0F .. 1.0F) != range1.contains(element25)) throw AssertionError() +} + +fun testR1xE26() { + // with possible local optimizations + if (3 in 3.0F .. 1.0F != range1.contains(3)) throw AssertionError() + if (3 !in 3.0F .. 1.0F != !range1.contains(3)) throw AssertionError() + if (!(3 in 3.0F .. 1.0F) != !range1.contains(3)) throw AssertionError() + if (!(3 !in 3.0F .. 1.0F) != range1.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in 3.0F .. 1.0F != range1.contains(element26)) throw AssertionError() + if (element26 !in 3.0F .. 1.0F != !range1.contains(element26)) throw AssertionError() + if (!(element26 in 3.0F .. 1.0F) != !range1.contains(element26)) throw AssertionError() + if (!(element26 !in 3.0F .. 1.0F) != range1.contains(element26)) throw AssertionError() +} + +fun testR1xE27() { + // with possible local optimizations + if (3.toLong() in 3.0F .. 1.0F != range1.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in 3.0F .. 1.0F != !range1.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in 3.0F .. 1.0F) != !range1.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in 3.0F .. 1.0F) != range1.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in 3.0F .. 1.0F != range1.contains(element27)) throw AssertionError() + if (element27 !in 3.0F .. 1.0F != !range1.contains(element27)) throw AssertionError() + if (!(element27 in 3.0F .. 1.0F) != !range1.contains(element27)) throw AssertionError() + if (!(element27 !in 3.0F .. 1.0F) != range1.contains(element27)) throw AssertionError() +} + +fun testR1xE28() { + // with possible local optimizations + if (3.toFloat() in 3.0F .. 1.0F != range1.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in 3.0F .. 1.0F != !range1.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in 3.0F .. 1.0F) != !range1.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in 3.0F .. 1.0F) != range1.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in 3.0F .. 1.0F != range1.contains(element28)) throw AssertionError() + if (element28 !in 3.0F .. 1.0F != !range1.contains(element28)) throw AssertionError() + if (!(element28 in 3.0F .. 1.0F) != !range1.contains(element28)) throw AssertionError() + if (!(element28 !in 3.0F .. 1.0F) != range1.contains(element28)) throw AssertionError() +} + +fun testR1xE29() { + // with possible local optimizations + if (3.toDouble() in 3.0F .. 1.0F != range1.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in 3.0F .. 1.0F != !range1.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in 3.0F .. 1.0F) != !range1.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in 3.0F .. 1.0F) != range1.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in 3.0F .. 1.0F != range1.contains(element29)) throw AssertionError() + if (element29 !in 3.0F .. 1.0F != !range1.contains(element29)) throw AssertionError() + if (!(element29 in 3.0F .. 1.0F) != !range1.contains(element29)) throw AssertionError() + if (!(element29 !in 3.0F .. 1.0F) != range1.contains(element29)) throw AssertionError() +} + +fun testR1xE30() { + // with possible local optimizations + if (4.toByte() in 3.0F .. 1.0F != range1.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 3.0F .. 1.0F != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 3.0F .. 1.0F) != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 3.0F .. 1.0F) != range1.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in 3.0F .. 1.0F != range1.contains(element30)) throw AssertionError() + if (element30 !in 3.0F .. 1.0F != !range1.contains(element30)) throw AssertionError() + if (!(element30 in 3.0F .. 1.0F) != !range1.contains(element30)) throw AssertionError() + if (!(element30 !in 3.0F .. 1.0F) != range1.contains(element30)) throw AssertionError() +} + +fun testR1xE31() { + // with possible local optimizations + if (4.toShort() in 3.0F .. 1.0F != range1.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 3.0F .. 1.0F != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 3.0F .. 1.0F) != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 3.0F .. 1.0F) != range1.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in 3.0F .. 1.0F != range1.contains(element31)) throw AssertionError() + if (element31 !in 3.0F .. 1.0F != !range1.contains(element31)) throw AssertionError() + if (!(element31 in 3.0F .. 1.0F) != !range1.contains(element31)) throw AssertionError() + if (!(element31 !in 3.0F .. 1.0F) != range1.contains(element31)) throw AssertionError() +} + +fun testR1xE32() { + // with possible local optimizations + if (4 in 3.0F .. 1.0F != range1.contains(4)) throw AssertionError() + if (4 !in 3.0F .. 1.0F != !range1.contains(4)) throw AssertionError() + if (!(4 in 3.0F .. 1.0F) != !range1.contains(4)) throw AssertionError() + if (!(4 !in 3.0F .. 1.0F) != range1.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in 3.0F .. 1.0F != range1.contains(element32)) throw AssertionError() + if (element32 !in 3.0F .. 1.0F != !range1.contains(element32)) throw AssertionError() + if (!(element32 in 3.0F .. 1.0F) != !range1.contains(element32)) throw AssertionError() + if (!(element32 !in 3.0F .. 1.0F) != range1.contains(element32)) throw AssertionError() +} + +fun testR1xE33() { + // with possible local optimizations + if (4.toLong() in 3.0F .. 1.0F != range1.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in 3.0F .. 1.0F != !range1.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in 3.0F .. 1.0F) != !range1.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in 3.0F .. 1.0F) != range1.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in 3.0F .. 1.0F != range1.contains(element33)) throw AssertionError() + if (element33 !in 3.0F .. 1.0F != !range1.contains(element33)) throw AssertionError() + if (!(element33 in 3.0F .. 1.0F) != !range1.contains(element33)) throw AssertionError() + if (!(element33 !in 3.0F .. 1.0F) != range1.contains(element33)) throw AssertionError() +} + +fun testR1xE34() { + // with possible local optimizations + if (4.toFloat() in 3.0F .. 1.0F != range1.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in 3.0F .. 1.0F != !range1.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in 3.0F .. 1.0F) != !range1.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in 3.0F .. 1.0F) != range1.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in 3.0F .. 1.0F != range1.contains(element34)) throw AssertionError() + if (element34 !in 3.0F .. 1.0F != !range1.contains(element34)) throw AssertionError() + if (!(element34 in 3.0F .. 1.0F) != !range1.contains(element34)) throw AssertionError() + if (!(element34 !in 3.0F .. 1.0F) != range1.contains(element34)) throw AssertionError() +} + +fun testR1xE35() { + // with possible local optimizations + if (4.toDouble() in 3.0F .. 1.0F != range1.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in 3.0F .. 1.0F != !range1.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in 3.0F .. 1.0F) != !range1.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in 3.0F .. 1.0F) != range1.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in 3.0F .. 1.0F != range1.contains(element35)) throw AssertionError() + if (element35 !in 3.0F .. 1.0F != !range1.contains(element35)) throw AssertionError() + if (!(element35 in 3.0F .. 1.0F) != !range1.contains(element35)) throw AssertionError() + if (!(element35 !in 3.0F .. 1.0F) != range1.contains(element35)) throw AssertionError() +} + + diff --git a/backend.native/tests/external/codegen/box/ranges/contains/generated/intDownTo.kt b/backend.native/tests/external/codegen/box/ranges/contains/generated/intDownTo.kt new file mode 100644 index 00000000000..5bda3e06c2f --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/generated/intDownTo.kt @@ -0,0 +1,43 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_RUNTIME + + + +val range0 = 3 downTo 1 +val range1 = 1 downTo 3 + +val element0 = 1 + +fun box(): String { + testR0xE0() + testR1xE0() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if (1 in 3 downTo 1 != range0.contains(1)) throw AssertionError() + if (1 !in 3 downTo 1 != !range0.contains(1)) throw AssertionError() + if (!(1 in 3 downTo 1) != !range0.contains(1)) throw AssertionError() + if (!(1 !in 3 downTo 1) != range0.contains(1)) throw AssertionError() + // no local optimizations + if (element0 in 3 downTo 1 != range0.contains(element0)) throw AssertionError() + if (element0 !in 3 downTo 1 != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 3 downTo 1) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 3 downTo 1) != range0.contains(element0)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if (1 in 1 downTo 3 != range1.contains(1)) throw AssertionError() + if (1 !in 1 downTo 3 != !range1.contains(1)) throw AssertionError() + if (!(1 in 1 downTo 3) != !range1.contains(1)) throw AssertionError() + if (!(1 !in 1 downTo 3) != range1.contains(1)) throw AssertionError() + // no local optimizations + if (element0 in 1 downTo 3 != range1.contains(element0)) throw AssertionError() + if (element0 !in 1 downTo 3 != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 1 downTo 3) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 1 downTo 3) != range1.contains(element0)) throw AssertionError() +} + + diff --git a/backend.native/tests/external/codegen/box/ranges/contains/generated/intRangeLiteral.kt b/backend.native/tests/external/codegen/box/ranges/contains/generated/intRangeLiteral.kt new file mode 100644 index 00000000000..5552b83dc8d --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/generated/intRangeLiteral.kt @@ -0,0 +1,1058 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_RUNTIME + + + +val range0 = 1 .. 3 +val range1 = 3 .. 1 + +val element0 = (-1).toByte() +val element1 = (-1).toShort() +val element2 = (-1) +val element3 = (-1).toLong() +val element4 = (-1).toFloat() +val element5 = (-1).toDouble() +val element6 = 0.toByte() +val element7 = 0.toShort() +val element8 = 0 +val element9 = 0.toLong() +val element10 = 0.toFloat() +val element11 = 0.toDouble() +val element12 = 1.toByte() +val element13 = 1.toShort() +val element14 = 1 +val element15 = 1.toLong() +val element16 = 1.toFloat() +val element17 = 1.toDouble() +val element18 = 2.toByte() +val element19 = 2.toShort() +val element20 = 2 +val element21 = 2.toLong() +val element22 = 2.toFloat() +val element23 = 2.toDouble() +val element24 = 3.toByte() +val element25 = 3.toShort() +val element26 = 3 +val element27 = 3.toLong() +val element28 = 3.toFloat() +val element29 = 3.toDouble() +val element30 = 4.toByte() +val element31 = 4.toShort() +val element32 = 4 +val element33 = 4.toLong() +val element34 = 4.toFloat() +val element35 = 4.toDouble() + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR0xE5() + testR0xE6() + testR0xE7() + testR0xE8() + testR0xE9() + testR0xE10() + testR0xE11() + testR0xE12() + testR0xE13() + testR0xE14() + testR0xE15() + testR0xE16() + testR0xE17() + testR0xE18() + testR0xE19() + testR0xE20() + testR0xE21() + testR0xE22() + testR0xE23() + testR0xE24() + testR0xE25() + testR0xE26() + testR0xE27() + testR0xE28() + testR0xE29() + testR0xE30() + testR0xE31() + testR0xE32() + testR0xE33() + testR0xE34() + testR0xE35() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + testR1xE5() + testR1xE6() + testR1xE7() + testR1xE8() + testR1xE9() + testR1xE10() + testR1xE11() + testR1xE12() + testR1xE13() + testR1xE14() + testR1xE15() + testR1xE16() + testR1xE17() + testR1xE18() + testR1xE19() + testR1xE20() + testR1xE21() + testR1xE22() + testR1xE23() + testR1xE24() + testR1xE25() + testR1xE26() + testR1xE27() + testR1xE28() + testR1xE29() + testR1xE30() + testR1xE31() + testR1xE32() + testR1xE33() + testR1xE34() + testR1xE35() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if ((-1).toByte() in 1 .. 3 != range0.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 1 .. 3 != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 1 .. 3) != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 1 .. 3) != range0.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 1 .. 3 != range0.contains(element0)) throw AssertionError() + if (element0 !in 1 .. 3 != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1 .. 3) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1 .. 3) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if ((-1).toShort() in 1 .. 3 != range0.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 1 .. 3 != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 1 .. 3) != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 1 .. 3) != range0.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 1 .. 3 != range0.contains(element1)) throw AssertionError() + if (element1 !in 1 .. 3 != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1 .. 3) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1 .. 3) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if ((-1) in 1 .. 3 != range0.contains((-1))) throw AssertionError() + if ((-1) !in 1 .. 3 != !range0.contains((-1))) throw AssertionError() + if (!((-1) in 1 .. 3) != !range0.contains((-1))) throw AssertionError() + if (!((-1) !in 1 .. 3) != range0.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in 1 .. 3 != range0.contains(element2)) throw AssertionError() + if (element2 !in 1 .. 3 != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1 .. 3) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1 .. 3) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if ((-1).toLong() in 1 .. 3 != range0.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in 1 .. 3 != !range0.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in 1 .. 3) != !range0.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in 1 .. 3) != range0.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in 1 .. 3 != range0.contains(element3)) throw AssertionError() + if (element3 !in 1 .. 3 != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1 .. 3) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1 .. 3) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if ((-1).toFloat() in 1 .. 3 != range0.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in 1 .. 3 != !range0.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in 1 .. 3) != !range0.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in 1 .. 3) != range0.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in 1 .. 3 != range0.contains(element4)) throw AssertionError() + if (element4 !in 1 .. 3 != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1 .. 3) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1 .. 3) != range0.contains(element4)) throw AssertionError() +} + +fun testR0xE5() { + // with possible local optimizations + if ((-1).toDouble() in 1 .. 3 != range0.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in 1 .. 3 != !range0.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in 1 .. 3) != !range0.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in 1 .. 3) != range0.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in 1 .. 3 != range0.contains(element5)) throw AssertionError() + if (element5 !in 1 .. 3 != !range0.contains(element5)) throw AssertionError() + if (!(element5 in 1 .. 3) != !range0.contains(element5)) throw AssertionError() + if (!(element5 !in 1 .. 3) != range0.contains(element5)) throw AssertionError() +} + +fun testR0xE6() { + // with possible local optimizations + if (0.toByte() in 1 .. 3 != range0.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 1 .. 3 != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 1 .. 3) != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 1 .. 3) != range0.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in 1 .. 3 != range0.contains(element6)) throw AssertionError() + if (element6 !in 1 .. 3 != !range0.contains(element6)) throw AssertionError() + if (!(element6 in 1 .. 3) != !range0.contains(element6)) throw AssertionError() + if (!(element6 !in 1 .. 3) != range0.contains(element6)) throw AssertionError() +} + +fun testR0xE7() { + // with possible local optimizations + if (0.toShort() in 1 .. 3 != range0.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 1 .. 3 != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 1 .. 3) != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 1 .. 3) != range0.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in 1 .. 3 != range0.contains(element7)) throw AssertionError() + if (element7 !in 1 .. 3 != !range0.contains(element7)) throw AssertionError() + if (!(element7 in 1 .. 3) != !range0.contains(element7)) throw AssertionError() + if (!(element7 !in 1 .. 3) != range0.contains(element7)) throw AssertionError() +} + +fun testR0xE8() { + // with possible local optimizations + if (0 in 1 .. 3 != range0.contains(0)) throw AssertionError() + if (0 !in 1 .. 3 != !range0.contains(0)) throw AssertionError() + if (!(0 in 1 .. 3) != !range0.contains(0)) throw AssertionError() + if (!(0 !in 1 .. 3) != range0.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in 1 .. 3 != range0.contains(element8)) throw AssertionError() + if (element8 !in 1 .. 3 != !range0.contains(element8)) throw AssertionError() + if (!(element8 in 1 .. 3) != !range0.contains(element8)) throw AssertionError() + if (!(element8 !in 1 .. 3) != range0.contains(element8)) throw AssertionError() +} + +fun testR0xE9() { + // with possible local optimizations + if (0.toLong() in 1 .. 3 != range0.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in 1 .. 3 != !range0.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in 1 .. 3) != !range0.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in 1 .. 3) != range0.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in 1 .. 3 != range0.contains(element9)) throw AssertionError() + if (element9 !in 1 .. 3 != !range0.contains(element9)) throw AssertionError() + if (!(element9 in 1 .. 3) != !range0.contains(element9)) throw AssertionError() + if (!(element9 !in 1 .. 3) != range0.contains(element9)) throw AssertionError() +} + +fun testR0xE10() { + // with possible local optimizations + if (0.toFloat() in 1 .. 3 != range0.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in 1 .. 3 != !range0.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in 1 .. 3) != !range0.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in 1 .. 3) != range0.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in 1 .. 3 != range0.contains(element10)) throw AssertionError() + if (element10 !in 1 .. 3 != !range0.contains(element10)) throw AssertionError() + if (!(element10 in 1 .. 3) != !range0.contains(element10)) throw AssertionError() + if (!(element10 !in 1 .. 3) != range0.contains(element10)) throw AssertionError() +} + +fun testR0xE11() { + // with possible local optimizations + if (0.toDouble() in 1 .. 3 != range0.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in 1 .. 3 != !range0.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in 1 .. 3) != !range0.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in 1 .. 3) != range0.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in 1 .. 3 != range0.contains(element11)) throw AssertionError() + if (element11 !in 1 .. 3 != !range0.contains(element11)) throw AssertionError() + if (!(element11 in 1 .. 3) != !range0.contains(element11)) throw AssertionError() + if (!(element11 !in 1 .. 3) != range0.contains(element11)) throw AssertionError() +} + +fun testR0xE12() { + // with possible local optimizations + if (1.toByte() in 1 .. 3 != range0.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 1 .. 3 != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 1 .. 3) != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 1 .. 3) != range0.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 1 .. 3 != range0.contains(element12)) throw AssertionError() + if (element12 !in 1 .. 3 != !range0.contains(element12)) throw AssertionError() + if (!(element12 in 1 .. 3) != !range0.contains(element12)) throw AssertionError() + if (!(element12 !in 1 .. 3) != range0.contains(element12)) throw AssertionError() +} + +fun testR0xE13() { + // with possible local optimizations + if (1.toShort() in 1 .. 3 != range0.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 1 .. 3 != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 1 .. 3) != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 1 .. 3) != range0.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 1 .. 3 != range0.contains(element13)) throw AssertionError() + if (element13 !in 1 .. 3 != !range0.contains(element13)) throw AssertionError() + if (!(element13 in 1 .. 3) != !range0.contains(element13)) throw AssertionError() + if (!(element13 !in 1 .. 3) != range0.contains(element13)) throw AssertionError() +} + +fun testR0xE14() { + // with possible local optimizations + if (1 in 1 .. 3 != range0.contains(1)) throw AssertionError() + if (1 !in 1 .. 3 != !range0.contains(1)) throw AssertionError() + if (!(1 in 1 .. 3) != !range0.contains(1)) throw AssertionError() + if (!(1 !in 1 .. 3) != range0.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in 1 .. 3 != range0.contains(element14)) throw AssertionError() + if (element14 !in 1 .. 3 != !range0.contains(element14)) throw AssertionError() + if (!(element14 in 1 .. 3) != !range0.contains(element14)) throw AssertionError() + if (!(element14 !in 1 .. 3) != range0.contains(element14)) throw AssertionError() +} + +fun testR0xE15() { + // with possible local optimizations + if (1.toLong() in 1 .. 3 != range0.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in 1 .. 3 != !range0.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in 1 .. 3) != !range0.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in 1 .. 3) != range0.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in 1 .. 3 != range0.contains(element15)) throw AssertionError() + if (element15 !in 1 .. 3 != !range0.contains(element15)) throw AssertionError() + if (!(element15 in 1 .. 3) != !range0.contains(element15)) throw AssertionError() + if (!(element15 !in 1 .. 3) != range0.contains(element15)) throw AssertionError() +} + +fun testR0xE16() { + // with possible local optimizations + if (1.toFloat() in 1 .. 3 != range0.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in 1 .. 3 != !range0.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in 1 .. 3) != !range0.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in 1 .. 3) != range0.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in 1 .. 3 != range0.contains(element16)) throw AssertionError() + if (element16 !in 1 .. 3 != !range0.contains(element16)) throw AssertionError() + if (!(element16 in 1 .. 3) != !range0.contains(element16)) throw AssertionError() + if (!(element16 !in 1 .. 3) != range0.contains(element16)) throw AssertionError() +} + +fun testR0xE17() { + // with possible local optimizations + if (1.toDouble() in 1 .. 3 != range0.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in 1 .. 3 != !range0.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in 1 .. 3) != !range0.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in 1 .. 3) != range0.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in 1 .. 3 != range0.contains(element17)) throw AssertionError() + if (element17 !in 1 .. 3 != !range0.contains(element17)) throw AssertionError() + if (!(element17 in 1 .. 3) != !range0.contains(element17)) throw AssertionError() + if (!(element17 !in 1 .. 3) != range0.contains(element17)) throw AssertionError() +} + +fun testR0xE18() { + // with possible local optimizations + if (2.toByte() in 1 .. 3 != range0.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 1 .. 3 != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 1 .. 3) != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 1 .. 3) != range0.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in 1 .. 3 != range0.contains(element18)) throw AssertionError() + if (element18 !in 1 .. 3 != !range0.contains(element18)) throw AssertionError() + if (!(element18 in 1 .. 3) != !range0.contains(element18)) throw AssertionError() + if (!(element18 !in 1 .. 3) != range0.contains(element18)) throw AssertionError() +} + +fun testR0xE19() { + // with possible local optimizations + if (2.toShort() in 1 .. 3 != range0.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 1 .. 3 != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 1 .. 3) != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 1 .. 3) != range0.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in 1 .. 3 != range0.contains(element19)) throw AssertionError() + if (element19 !in 1 .. 3 != !range0.contains(element19)) throw AssertionError() + if (!(element19 in 1 .. 3) != !range0.contains(element19)) throw AssertionError() + if (!(element19 !in 1 .. 3) != range0.contains(element19)) throw AssertionError() +} + +fun testR0xE20() { + // with possible local optimizations + if (2 in 1 .. 3 != range0.contains(2)) throw AssertionError() + if (2 !in 1 .. 3 != !range0.contains(2)) throw AssertionError() + if (!(2 in 1 .. 3) != !range0.contains(2)) throw AssertionError() + if (!(2 !in 1 .. 3) != range0.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in 1 .. 3 != range0.contains(element20)) throw AssertionError() + if (element20 !in 1 .. 3 != !range0.contains(element20)) throw AssertionError() + if (!(element20 in 1 .. 3) != !range0.contains(element20)) throw AssertionError() + if (!(element20 !in 1 .. 3) != range0.contains(element20)) throw AssertionError() +} + +fun testR0xE21() { + // with possible local optimizations + if (2.toLong() in 1 .. 3 != range0.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in 1 .. 3 != !range0.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in 1 .. 3) != !range0.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in 1 .. 3) != range0.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in 1 .. 3 != range0.contains(element21)) throw AssertionError() + if (element21 !in 1 .. 3 != !range0.contains(element21)) throw AssertionError() + if (!(element21 in 1 .. 3) != !range0.contains(element21)) throw AssertionError() + if (!(element21 !in 1 .. 3) != range0.contains(element21)) throw AssertionError() +} + +fun testR0xE22() { + // with possible local optimizations + if (2.toFloat() in 1 .. 3 != range0.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in 1 .. 3 != !range0.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in 1 .. 3) != !range0.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in 1 .. 3) != range0.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in 1 .. 3 != range0.contains(element22)) throw AssertionError() + if (element22 !in 1 .. 3 != !range0.contains(element22)) throw AssertionError() + if (!(element22 in 1 .. 3) != !range0.contains(element22)) throw AssertionError() + if (!(element22 !in 1 .. 3) != range0.contains(element22)) throw AssertionError() +} + +fun testR0xE23() { + // with possible local optimizations + if (2.toDouble() in 1 .. 3 != range0.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in 1 .. 3 != !range0.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in 1 .. 3) != !range0.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in 1 .. 3) != range0.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in 1 .. 3 != range0.contains(element23)) throw AssertionError() + if (element23 !in 1 .. 3 != !range0.contains(element23)) throw AssertionError() + if (!(element23 in 1 .. 3) != !range0.contains(element23)) throw AssertionError() + if (!(element23 !in 1 .. 3) != range0.contains(element23)) throw AssertionError() +} + +fun testR0xE24() { + // with possible local optimizations + if (3.toByte() in 1 .. 3 != range0.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 1 .. 3 != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 1 .. 3) != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 1 .. 3) != range0.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in 1 .. 3 != range0.contains(element24)) throw AssertionError() + if (element24 !in 1 .. 3 != !range0.contains(element24)) throw AssertionError() + if (!(element24 in 1 .. 3) != !range0.contains(element24)) throw AssertionError() + if (!(element24 !in 1 .. 3) != range0.contains(element24)) throw AssertionError() +} + +fun testR0xE25() { + // with possible local optimizations + if (3.toShort() in 1 .. 3 != range0.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 1 .. 3 != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 1 .. 3) != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 1 .. 3) != range0.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in 1 .. 3 != range0.contains(element25)) throw AssertionError() + if (element25 !in 1 .. 3 != !range0.contains(element25)) throw AssertionError() + if (!(element25 in 1 .. 3) != !range0.contains(element25)) throw AssertionError() + if (!(element25 !in 1 .. 3) != range0.contains(element25)) throw AssertionError() +} + +fun testR0xE26() { + // with possible local optimizations + if (3 in 1 .. 3 != range0.contains(3)) throw AssertionError() + if (3 !in 1 .. 3 != !range0.contains(3)) throw AssertionError() + if (!(3 in 1 .. 3) != !range0.contains(3)) throw AssertionError() + if (!(3 !in 1 .. 3) != range0.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in 1 .. 3 != range0.contains(element26)) throw AssertionError() + if (element26 !in 1 .. 3 != !range0.contains(element26)) throw AssertionError() + if (!(element26 in 1 .. 3) != !range0.contains(element26)) throw AssertionError() + if (!(element26 !in 1 .. 3) != range0.contains(element26)) throw AssertionError() +} + +fun testR0xE27() { + // with possible local optimizations + if (3.toLong() in 1 .. 3 != range0.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in 1 .. 3 != !range0.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in 1 .. 3) != !range0.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in 1 .. 3) != range0.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in 1 .. 3 != range0.contains(element27)) throw AssertionError() + if (element27 !in 1 .. 3 != !range0.contains(element27)) throw AssertionError() + if (!(element27 in 1 .. 3) != !range0.contains(element27)) throw AssertionError() + if (!(element27 !in 1 .. 3) != range0.contains(element27)) throw AssertionError() +} + +fun testR0xE28() { + // with possible local optimizations + if (3.toFloat() in 1 .. 3 != range0.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in 1 .. 3 != !range0.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in 1 .. 3) != !range0.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in 1 .. 3) != range0.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in 1 .. 3 != range0.contains(element28)) throw AssertionError() + if (element28 !in 1 .. 3 != !range0.contains(element28)) throw AssertionError() + if (!(element28 in 1 .. 3) != !range0.contains(element28)) throw AssertionError() + if (!(element28 !in 1 .. 3) != range0.contains(element28)) throw AssertionError() +} + +fun testR0xE29() { + // with possible local optimizations + if (3.toDouble() in 1 .. 3 != range0.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in 1 .. 3 != !range0.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in 1 .. 3) != !range0.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in 1 .. 3) != range0.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in 1 .. 3 != range0.contains(element29)) throw AssertionError() + if (element29 !in 1 .. 3 != !range0.contains(element29)) throw AssertionError() + if (!(element29 in 1 .. 3) != !range0.contains(element29)) throw AssertionError() + if (!(element29 !in 1 .. 3) != range0.contains(element29)) throw AssertionError() +} + +fun testR0xE30() { + // with possible local optimizations + if (4.toByte() in 1 .. 3 != range0.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 1 .. 3 != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 1 .. 3) != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 1 .. 3) != range0.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in 1 .. 3 != range0.contains(element30)) throw AssertionError() + if (element30 !in 1 .. 3 != !range0.contains(element30)) throw AssertionError() + if (!(element30 in 1 .. 3) != !range0.contains(element30)) throw AssertionError() + if (!(element30 !in 1 .. 3) != range0.contains(element30)) throw AssertionError() +} + +fun testR0xE31() { + // with possible local optimizations + if (4.toShort() in 1 .. 3 != range0.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 1 .. 3 != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 1 .. 3) != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 1 .. 3) != range0.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in 1 .. 3 != range0.contains(element31)) throw AssertionError() + if (element31 !in 1 .. 3 != !range0.contains(element31)) throw AssertionError() + if (!(element31 in 1 .. 3) != !range0.contains(element31)) throw AssertionError() + if (!(element31 !in 1 .. 3) != range0.contains(element31)) throw AssertionError() +} + +fun testR0xE32() { + // with possible local optimizations + if (4 in 1 .. 3 != range0.contains(4)) throw AssertionError() + if (4 !in 1 .. 3 != !range0.contains(4)) throw AssertionError() + if (!(4 in 1 .. 3) != !range0.contains(4)) throw AssertionError() + if (!(4 !in 1 .. 3) != range0.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in 1 .. 3 != range0.contains(element32)) throw AssertionError() + if (element32 !in 1 .. 3 != !range0.contains(element32)) throw AssertionError() + if (!(element32 in 1 .. 3) != !range0.contains(element32)) throw AssertionError() + if (!(element32 !in 1 .. 3) != range0.contains(element32)) throw AssertionError() +} + +fun testR0xE33() { + // with possible local optimizations + if (4.toLong() in 1 .. 3 != range0.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in 1 .. 3 != !range0.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in 1 .. 3) != !range0.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in 1 .. 3) != range0.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in 1 .. 3 != range0.contains(element33)) throw AssertionError() + if (element33 !in 1 .. 3 != !range0.contains(element33)) throw AssertionError() + if (!(element33 in 1 .. 3) != !range0.contains(element33)) throw AssertionError() + if (!(element33 !in 1 .. 3) != range0.contains(element33)) throw AssertionError() +} + +fun testR0xE34() { + // with possible local optimizations + if (4.toFloat() in 1 .. 3 != range0.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in 1 .. 3 != !range0.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in 1 .. 3) != !range0.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in 1 .. 3) != range0.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in 1 .. 3 != range0.contains(element34)) throw AssertionError() + if (element34 !in 1 .. 3 != !range0.contains(element34)) throw AssertionError() + if (!(element34 in 1 .. 3) != !range0.contains(element34)) throw AssertionError() + if (!(element34 !in 1 .. 3) != range0.contains(element34)) throw AssertionError() +} + +fun testR0xE35() { + // with possible local optimizations + if (4.toDouble() in 1 .. 3 != range0.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in 1 .. 3 != !range0.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in 1 .. 3) != !range0.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in 1 .. 3) != range0.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in 1 .. 3 != range0.contains(element35)) throw AssertionError() + if (element35 !in 1 .. 3 != !range0.contains(element35)) throw AssertionError() + if (!(element35 in 1 .. 3) != !range0.contains(element35)) throw AssertionError() + if (!(element35 !in 1 .. 3) != range0.contains(element35)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if ((-1).toByte() in 3 .. 1 != range1.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 3 .. 1 != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 3 .. 1) != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 3 .. 1) != range1.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 3 .. 1 != range1.contains(element0)) throw AssertionError() + if (element0 !in 3 .. 1 != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3 .. 1) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3 .. 1) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if ((-1).toShort() in 3 .. 1 != range1.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 3 .. 1 != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 3 .. 1) != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 3 .. 1) != range1.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 3 .. 1 != range1.contains(element1)) throw AssertionError() + if (element1 !in 3 .. 1 != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3 .. 1) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3 .. 1) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if ((-1) in 3 .. 1 != range1.contains((-1))) throw AssertionError() + if ((-1) !in 3 .. 1 != !range1.contains((-1))) throw AssertionError() + if (!((-1) in 3 .. 1) != !range1.contains((-1))) throw AssertionError() + if (!((-1) !in 3 .. 1) != range1.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in 3 .. 1 != range1.contains(element2)) throw AssertionError() + if (element2 !in 3 .. 1 != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3 .. 1) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3 .. 1) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if ((-1).toLong() in 3 .. 1 != range1.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in 3 .. 1 != !range1.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in 3 .. 1) != !range1.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in 3 .. 1) != range1.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in 3 .. 1 != range1.contains(element3)) throw AssertionError() + if (element3 !in 3 .. 1 != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3 .. 1) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3 .. 1) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if ((-1).toFloat() in 3 .. 1 != range1.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in 3 .. 1 != !range1.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in 3 .. 1) != !range1.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in 3 .. 1) != range1.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in 3 .. 1 != range1.contains(element4)) throw AssertionError() + if (element4 !in 3 .. 1 != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3 .. 1) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3 .. 1) != range1.contains(element4)) throw AssertionError() +} + +fun testR1xE5() { + // with possible local optimizations + if ((-1).toDouble() in 3 .. 1 != range1.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in 3 .. 1 != !range1.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in 3 .. 1) != !range1.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in 3 .. 1) != range1.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in 3 .. 1 != range1.contains(element5)) throw AssertionError() + if (element5 !in 3 .. 1 != !range1.contains(element5)) throw AssertionError() + if (!(element5 in 3 .. 1) != !range1.contains(element5)) throw AssertionError() + if (!(element5 !in 3 .. 1) != range1.contains(element5)) throw AssertionError() +} + +fun testR1xE6() { + // with possible local optimizations + if (0.toByte() in 3 .. 1 != range1.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 3 .. 1 != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 3 .. 1) != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 3 .. 1) != range1.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in 3 .. 1 != range1.contains(element6)) throw AssertionError() + if (element6 !in 3 .. 1 != !range1.contains(element6)) throw AssertionError() + if (!(element6 in 3 .. 1) != !range1.contains(element6)) throw AssertionError() + if (!(element6 !in 3 .. 1) != range1.contains(element6)) throw AssertionError() +} + +fun testR1xE7() { + // with possible local optimizations + if (0.toShort() in 3 .. 1 != range1.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 3 .. 1 != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 3 .. 1) != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 3 .. 1) != range1.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in 3 .. 1 != range1.contains(element7)) throw AssertionError() + if (element7 !in 3 .. 1 != !range1.contains(element7)) throw AssertionError() + if (!(element7 in 3 .. 1) != !range1.contains(element7)) throw AssertionError() + if (!(element7 !in 3 .. 1) != range1.contains(element7)) throw AssertionError() +} + +fun testR1xE8() { + // with possible local optimizations + if (0 in 3 .. 1 != range1.contains(0)) throw AssertionError() + if (0 !in 3 .. 1 != !range1.contains(0)) throw AssertionError() + if (!(0 in 3 .. 1) != !range1.contains(0)) throw AssertionError() + if (!(0 !in 3 .. 1) != range1.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in 3 .. 1 != range1.contains(element8)) throw AssertionError() + if (element8 !in 3 .. 1 != !range1.contains(element8)) throw AssertionError() + if (!(element8 in 3 .. 1) != !range1.contains(element8)) throw AssertionError() + if (!(element8 !in 3 .. 1) != range1.contains(element8)) throw AssertionError() +} + +fun testR1xE9() { + // with possible local optimizations + if (0.toLong() in 3 .. 1 != range1.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in 3 .. 1 != !range1.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in 3 .. 1) != !range1.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in 3 .. 1) != range1.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in 3 .. 1 != range1.contains(element9)) throw AssertionError() + if (element9 !in 3 .. 1 != !range1.contains(element9)) throw AssertionError() + if (!(element9 in 3 .. 1) != !range1.contains(element9)) throw AssertionError() + if (!(element9 !in 3 .. 1) != range1.contains(element9)) throw AssertionError() +} + +fun testR1xE10() { + // with possible local optimizations + if (0.toFloat() in 3 .. 1 != range1.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in 3 .. 1 != !range1.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in 3 .. 1) != !range1.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in 3 .. 1) != range1.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in 3 .. 1 != range1.contains(element10)) throw AssertionError() + if (element10 !in 3 .. 1 != !range1.contains(element10)) throw AssertionError() + if (!(element10 in 3 .. 1) != !range1.contains(element10)) throw AssertionError() + if (!(element10 !in 3 .. 1) != range1.contains(element10)) throw AssertionError() +} + +fun testR1xE11() { + // with possible local optimizations + if (0.toDouble() in 3 .. 1 != range1.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in 3 .. 1 != !range1.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in 3 .. 1) != !range1.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in 3 .. 1) != range1.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in 3 .. 1 != range1.contains(element11)) throw AssertionError() + if (element11 !in 3 .. 1 != !range1.contains(element11)) throw AssertionError() + if (!(element11 in 3 .. 1) != !range1.contains(element11)) throw AssertionError() + if (!(element11 !in 3 .. 1) != range1.contains(element11)) throw AssertionError() +} + +fun testR1xE12() { + // with possible local optimizations + if (1.toByte() in 3 .. 1 != range1.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 3 .. 1 != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 3 .. 1) != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 3 .. 1) != range1.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 3 .. 1 != range1.contains(element12)) throw AssertionError() + if (element12 !in 3 .. 1 != !range1.contains(element12)) throw AssertionError() + if (!(element12 in 3 .. 1) != !range1.contains(element12)) throw AssertionError() + if (!(element12 !in 3 .. 1) != range1.contains(element12)) throw AssertionError() +} + +fun testR1xE13() { + // with possible local optimizations + if (1.toShort() in 3 .. 1 != range1.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 3 .. 1 != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 3 .. 1) != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 3 .. 1) != range1.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 3 .. 1 != range1.contains(element13)) throw AssertionError() + if (element13 !in 3 .. 1 != !range1.contains(element13)) throw AssertionError() + if (!(element13 in 3 .. 1) != !range1.contains(element13)) throw AssertionError() + if (!(element13 !in 3 .. 1) != range1.contains(element13)) throw AssertionError() +} + +fun testR1xE14() { + // with possible local optimizations + if (1 in 3 .. 1 != range1.contains(1)) throw AssertionError() + if (1 !in 3 .. 1 != !range1.contains(1)) throw AssertionError() + if (!(1 in 3 .. 1) != !range1.contains(1)) throw AssertionError() + if (!(1 !in 3 .. 1) != range1.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in 3 .. 1 != range1.contains(element14)) throw AssertionError() + if (element14 !in 3 .. 1 != !range1.contains(element14)) throw AssertionError() + if (!(element14 in 3 .. 1) != !range1.contains(element14)) throw AssertionError() + if (!(element14 !in 3 .. 1) != range1.contains(element14)) throw AssertionError() +} + +fun testR1xE15() { + // with possible local optimizations + if (1.toLong() in 3 .. 1 != range1.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in 3 .. 1 != !range1.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in 3 .. 1) != !range1.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in 3 .. 1) != range1.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in 3 .. 1 != range1.contains(element15)) throw AssertionError() + if (element15 !in 3 .. 1 != !range1.contains(element15)) throw AssertionError() + if (!(element15 in 3 .. 1) != !range1.contains(element15)) throw AssertionError() + if (!(element15 !in 3 .. 1) != range1.contains(element15)) throw AssertionError() +} + +fun testR1xE16() { + // with possible local optimizations + if (1.toFloat() in 3 .. 1 != range1.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in 3 .. 1 != !range1.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in 3 .. 1) != !range1.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in 3 .. 1) != range1.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in 3 .. 1 != range1.contains(element16)) throw AssertionError() + if (element16 !in 3 .. 1 != !range1.contains(element16)) throw AssertionError() + if (!(element16 in 3 .. 1) != !range1.contains(element16)) throw AssertionError() + if (!(element16 !in 3 .. 1) != range1.contains(element16)) throw AssertionError() +} + +fun testR1xE17() { + // with possible local optimizations + if (1.toDouble() in 3 .. 1 != range1.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in 3 .. 1 != !range1.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in 3 .. 1) != !range1.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in 3 .. 1) != range1.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in 3 .. 1 != range1.contains(element17)) throw AssertionError() + if (element17 !in 3 .. 1 != !range1.contains(element17)) throw AssertionError() + if (!(element17 in 3 .. 1) != !range1.contains(element17)) throw AssertionError() + if (!(element17 !in 3 .. 1) != range1.contains(element17)) throw AssertionError() +} + +fun testR1xE18() { + // with possible local optimizations + if (2.toByte() in 3 .. 1 != range1.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 3 .. 1 != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 3 .. 1) != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 3 .. 1) != range1.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in 3 .. 1 != range1.contains(element18)) throw AssertionError() + if (element18 !in 3 .. 1 != !range1.contains(element18)) throw AssertionError() + if (!(element18 in 3 .. 1) != !range1.contains(element18)) throw AssertionError() + if (!(element18 !in 3 .. 1) != range1.contains(element18)) throw AssertionError() +} + +fun testR1xE19() { + // with possible local optimizations + if (2.toShort() in 3 .. 1 != range1.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 3 .. 1 != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 3 .. 1) != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 3 .. 1) != range1.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in 3 .. 1 != range1.contains(element19)) throw AssertionError() + if (element19 !in 3 .. 1 != !range1.contains(element19)) throw AssertionError() + if (!(element19 in 3 .. 1) != !range1.contains(element19)) throw AssertionError() + if (!(element19 !in 3 .. 1) != range1.contains(element19)) throw AssertionError() +} + +fun testR1xE20() { + // with possible local optimizations + if (2 in 3 .. 1 != range1.contains(2)) throw AssertionError() + if (2 !in 3 .. 1 != !range1.contains(2)) throw AssertionError() + if (!(2 in 3 .. 1) != !range1.contains(2)) throw AssertionError() + if (!(2 !in 3 .. 1) != range1.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in 3 .. 1 != range1.contains(element20)) throw AssertionError() + if (element20 !in 3 .. 1 != !range1.contains(element20)) throw AssertionError() + if (!(element20 in 3 .. 1) != !range1.contains(element20)) throw AssertionError() + if (!(element20 !in 3 .. 1) != range1.contains(element20)) throw AssertionError() +} + +fun testR1xE21() { + // with possible local optimizations + if (2.toLong() in 3 .. 1 != range1.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in 3 .. 1 != !range1.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in 3 .. 1) != !range1.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in 3 .. 1) != range1.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in 3 .. 1 != range1.contains(element21)) throw AssertionError() + if (element21 !in 3 .. 1 != !range1.contains(element21)) throw AssertionError() + if (!(element21 in 3 .. 1) != !range1.contains(element21)) throw AssertionError() + if (!(element21 !in 3 .. 1) != range1.contains(element21)) throw AssertionError() +} + +fun testR1xE22() { + // with possible local optimizations + if (2.toFloat() in 3 .. 1 != range1.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in 3 .. 1 != !range1.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in 3 .. 1) != !range1.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in 3 .. 1) != range1.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in 3 .. 1 != range1.contains(element22)) throw AssertionError() + if (element22 !in 3 .. 1 != !range1.contains(element22)) throw AssertionError() + if (!(element22 in 3 .. 1) != !range1.contains(element22)) throw AssertionError() + if (!(element22 !in 3 .. 1) != range1.contains(element22)) throw AssertionError() +} + +fun testR1xE23() { + // with possible local optimizations + if (2.toDouble() in 3 .. 1 != range1.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in 3 .. 1 != !range1.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in 3 .. 1) != !range1.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in 3 .. 1) != range1.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in 3 .. 1 != range1.contains(element23)) throw AssertionError() + if (element23 !in 3 .. 1 != !range1.contains(element23)) throw AssertionError() + if (!(element23 in 3 .. 1) != !range1.contains(element23)) throw AssertionError() + if (!(element23 !in 3 .. 1) != range1.contains(element23)) throw AssertionError() +} + +fun testR1xE24() { + // with possible local optimizations + if (3.toByte() in 3 .. 1 != range1.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 3 .. 1 != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 3 .. 1) != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 3 .. 1) != range1.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in 3 .. 1 != range1.contains(element24)) throw AssertionError() + if (element24 !in 3 .. 1 != !range1.contains(element24)) throw AssertionError() + if (!(element24 in 3 .. 1) != !range1.contains(element24)) throw AssertionError() + if (!(element24 !in 3 .. 1) != range1.contains(element24)) throw AssertionError() +} + +fun testR1xE25() { + // with possible local optimizations + if (3.toShort() in 3 .. 1 != range1.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 3 .. 1 != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 3 .. 1) != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 3 .. 1) != range1.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in 3 .. 1 != range1.contains(element25)) throw AssertionError() + if (element25 !in 3 .. 1 != !range1.contains(element25)) throw AssertionError() + if (!(element25 in 3 .. 1) != !range1.contains(element25)) throw AssertionError() + if (!(element25 !in 3 .. 1) != range1.contains(element25)) throw AssertionError() +} + +fun testR1xE26() { + // with possible local optimizations + if (3 in 3 .. 1 != range1.contains(3)) throw AssertionError() + if (3 !in 3 .. 1 != !range1.contains(3)) throw AssertionError() + if (!(3 in 3 .. 1) != !range1.contains(3)) throw AssertionError() + if (!(3 !in 3 .. 1) != range1.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in 3 .. 1 != range1.contains(element26)) throw AssertionError() + if (element26 !in 3 .. 1 != !range1.contains(element26)) throw AssertionError() + if (!(element26 in 3 .. 1) != !range1.contains(element26)) throw AssertionError() + if (!(element26 !in 3 .. 1) != range1.contains(element26)) throw AssertionError() +} + +fun testR1xE27() { + // with possible local optimizations + if (3.toLong() in 3 .. 1 != range1.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in 3 .. 1 != !range1.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in 3 .. 1) != !range1.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in 3 .. 1) != range1.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in 3 .. 1 != range1.contains(element27)) throw AssertionError() + if (element27 !in 3 .. 1 != !range1.contains(element27)) throw AssertionError() + if (!(element27 in 3 .. 1) != !range1.contains(element27)) throw AssertionError() + if (!(element27 !in 3 .. 1) != range1.contains(element27)) throw AssertionError() +} + +fun testR1xE28() { + // with possible local optimizations + if (3.toFloat() in 3 .. 1 != range1.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in 3 .. 1 != !range1.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in 3 .. 1) != !range1.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in 3 .. 1) != range1.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in 3 .. 1 != range1.contains(element28)) throw AssertionError() + if (element28 !in 3 .. 1 != !range1.contains(element28)) throw AssertionError() + if (!(element28 in 3 .. 1) != !range1.contains(element28)) throw AssertionError() + if (!(element28 !in 3 .. 1) != range1.contains(element28)) throw AssertionError() +} + +fun testR1xE29() { + // with possible local optimizations + if (3.toDouble() in 3 .. 1 != range1.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in 3 .. 1 != !range1.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in 3 .. 1) != !range1.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in 3 .. 1) != range1.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in 3 .. 1 != range1.contains(element29)) throw AssertionError() + if (element29 !in 3 .. 1 != !range1.contains(element29)) throw AssertionError() + if (!(element29 in 3 .. 1) != !range1.contains(element29)) throw AssertionError() + if (!(element29 !in 3 .. 1) != range1.contains(element29)) throw AssertionError() +} + +fun testR1xE30() { + // with possible local optimizations + if (4.toByte() in 3 .. 1 != range1.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 3 .. 1 != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 3 .. 1) != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 3 .. 1) != range1.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in 3 .. 1 != range1.contains(element30)) throw AssertionError() + if (element30 !in 3 .. 1 != !range1.contains(element30)) throw AssertionError() + if (!(element30 in 3 .. 1) != !range1.contains(element30)) throw AssertionError() + if (!(element30 !in 3 .. 1) != range1.contains(element30)) throw AssertionError() +} + +fun testR1xE31() { + // with possible local optimizations + if (4.toShort() in 3 .. 1 != range1.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 3 .. 1 != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 3 .. 1) != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 3 .. 1) != range1.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in 3 .. 1 != range1.contains(element31)) throw AssertionError() + if (element31 !in 3 .. 1 != !range1.contains(element31)) throw AssertionError() + if (!(element31 in 3 .. 1) != !range1.contains(element31)) throw AssertionError() + if (!(element31 !in 3 .. 1) != range1.contains(element31)) throw AssertionError() +} + +fun testR1xE32() { + // with possible local optimizations + if (4 in 3 .. 1 != range1.contains(4)) throw AssertionError() + if (4 !in 3 .. 1 != !range1.contains(4)) throw AssertionError() + if (!(4 in 3 .. 1) != !range1.contains(4)) throw AssertionError() + if (!(4 !in 3 .. 1) != range1.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in 3 .. 1 != range1.contains(element32)) throw AssertionError() + if (element32 !in 3 .. 1 != !range1.contains(element32)) throw AssertionError() + if (!(element32 in 3 .. 1) != !range1.contains(element32)) throw AssertionError() + if (!(element32 !in 3 .. 1) != range1.contains(element32)) throw AssertionError() +} + +fun testR1xE33() { + // with possible local optimizations + if (4.toLong() in 3 .. 1 != range1.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in 3 .. 1 != !range1.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in 3 .. 1) != !range1.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in 3 .. 1) != range1.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in 3 .. 1 != range1.contains(element33)) throw AssertionError() + if (element33 !in 3 .. 1 != !range1.contains(element33)) throw AssertionError() + if (!(element33 in 3 .. 1) != !range1.contains(element33)) throw AssertionError() + if (!(element33 !in 3 .. 1) != range1.contains(element33)) throw AssertionError() +} + +fun testR1xE34() { + // with possible local optimizations + if (4.toFloat() in 3 .. 1 != range1.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in 3 .. 1 != !range1.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in 3 .. 1) != !range1.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in 3 .. 1) != range1.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in 3 .. 1 != range1.contains(element34)) throw AssertionError() + if (element34 !in 3 .. 1 != !range1.contains(element34)) throw AssertionError() + if (!(element34 in 3 .. 1) != !range1.contains(element34)) throw AssertionError() + if (!(element34 !in 3 .. 1) != range1.contains(element34)) throw AssertionError() +} + +fun testR1xE35() { + // with possible local optimizations + if (4.toDouble() in 3 .. 1 != range1.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in 3 .. 1 != !range1.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in 3 .. 1) != !range1.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in 3 .. 1) != range1.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in 3 .. 1 != range1.contains(element35)) throw AssertionError() + if (element35 !in 3 .. 1 != !range1.contains(element35)) throw AssertionError() + if (!(element35 in 3 .. 1) != !range1.contains(element35)) throw AssertionError() + if (!(element35 !in 3 .. 1) != range1.contains(element35)) throw AssertionError() +} + + diff --git a/backend.native/tests/external/codegen/box/ranges/contains/generated/intUntil.kt b/backend.native/tests/external/codegen/box/ranges/contains/generated/intUntil.kt new file mode 100644 index 00000000000..036c8f06b55 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/generated/intUntil.kt @@ -0,0 +1,1058 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_RUNTIME + + + +val range0 = 1 until 3 +val range1 = 3 until 1 + +val element0 = (-1).toByte() +val element1 = (-1).toShort() +val element2 = (-1) +val element3 = (-1).toLong() +val element4 = (-1).toFloat() +val element5 = (-1).toDouble() +val element6 = 0.toByte() +val element7 = 0.toShort() +val element8 = 0 +val element9 = 0.toLong() +val element10 = 0.toFloat() +val element11 = 0.toDouble() +val element12 = 1.toByte() +val element13 = 1.toShort() +val element14 = 1 +val element15 = 1.toLong() +val element16 = 1.toFloat() +val element17 = 1.toDouble() +val element18 = 2.toByte() +val element19 = 2.toShort() +val element20 = 2 +val element21 = 2.toLong() +val element22 = 2.toFloat() +val element23 = 2.toDouble() +val element24 = 3.toByte() +val element25 = 3.toShort() +val element26 = 3 +val element27 = 3.toLong() +val element28 = 3.toFloat() +val element29 = 3.toDouble() +val element30 = 4.toByte() +val element31 = 4.toShort() +val element32 = 4 +val element33 = 4.toLong() +val element34 = 4.toFloat() +val element35 = 4.toDouble() + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR0xE5() + testR0xE6() + testR0xE7() + testR0xE8() + testR0xE9() + testR0xE10() + testR0xE11() + testR0xE12() + testR0xE13() + testR0xE14() + testR0xE15() + testR0xE16() + testR0xE17() + testR0xE18() + testR0xE19() + testR0xE20() + testR0xE21() + testR0xE22() + testR0xE23() + testR0xE24() + testR0xE25() + testR0xE26() + testR0xE27() + testR0xE28() + testR0xE29() + testR0xE30() + testR0xE31() + testR0xE32() + testR0xE33() + testR0xE34() + testR0xE35() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + testR1xE5() + testR1xE6() + testR1xE7() + testR1xE8() + testR1xE9() + testR1xE10() + testR1xE11() + testR1xE12() + testR1xE13() + testR1xE14() + testR1xE15() + testR1xE16() + testR1xE17() + testR1xE18() + testR1xE19() + testR1xE20() + testR1xE21() + testR1xE22() + testR1xE23() + testR1xE24() + testR1xE25() + testR1xE26() + testR1xE27() + testR1xE28() + testR1xE29() + testR1xE30() + testR1xE31() + testR1xE32() + testR1xE33() + testR1xE34() + testR1xE35() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if ((-1).toByte() in 1 until 3 != range0.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 1 until 3 != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 1 until 3) != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 1 until 3) != range0.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 1 until 3 != range0.contains(element0)) throw AssertionError() + if (element0 !in 1 until 3 != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1 until 3) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1 until 3) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if ((-1).toShort() in 1 until 3 != range0.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 1 until 3 != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 1 until 3) != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 1 until 3) != range0.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 1 until 3 != range0.contains(element1)) throw AssertionError() + if (element1 !in 1 until 3 != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1 until 3) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1 until 3) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if ((-1) in 1 until 3 != range0.contains((-1))) throw AssertionError() + if ((-1) !in 1 until 3 != !range0.contains((-1))) throw AssertionError() + if (!((-1) in 1 until 3) != !range0.contains((-1))) throw AssertionError() + if (!((-1) !in 1 until 3) != range0.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in 1 until 3 != range0.contains(element2)) throw AssertionError() + if (element2 !in 1 until 3 != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1 until 3) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1 until 3) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if ((-1).toLong() in 1 until 3 != range0.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in 1 until 3 != !range0.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in 1 until 3) != !range0.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in 1 until 3) != range0.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in 1 until 3 != range0.contains(element3)) throw AssertionError() + if (element3 !in 1 until 3 != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1 until 3) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1 until 3) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if ((-1).toFloat() in 1 until 3 != range0.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in 1 until 3 != !range0.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in 1 until 3) != !range0.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in 1 until 3) != range0.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in 1 until 3 != range0.contains(element4)) throw AssertionError() + if (element4 !in 1 until 3 != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1 until 3) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1 until 3) != range0.contains(element4)) throw AssertionError() +} + +fun testR0xE5() { + // with possible local optimizations + if ((-1).toDouble() in 1 until 3 != range0.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in 1 until 3 != !range0.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in 1 until 3) != !range0.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in 1 until 3) != range0.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in 1 until 3 != range0.contains(element5)) throw AssertionError() + if (element5 !in 1 until 3 != !range0.contains(element5)) throw AssertionError() + if (!(element5 in 1 until 3) != !range0.contains(element5)) throw AssertionError() + if (!(element5 !in 1 until 3) != range0.contains(element5)) throw AssertionError() +} + +fun testR0xE6() { + // with possible local optimizations + if (0.toByte() in 1 until 3 != range0.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 1 until 3 != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 1 until 3) != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 1 until 3) != range0.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in 1 until 3 != range0.contains(element6)) throw AssertionError() + if (element6 !in 1 until 3 != !range0.contains(element6)) throw AssertionError() + if (!(element6 in 1 until 3) != !range0.contains(element6)) throw AssertionError() + if (!(element6 !in 1 until 3) != range0.contains(element6)) throw AssertionError() +} + +fun testR0xE7() { + // with possible local optimizations + if (0.toShort() in 1 until 3 != range0.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 1 until 3 != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 1 until 3) != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 1 until 3) != range0.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in 1 until 3 != range0.contains(element7)) throw AssertionError() + if (element7 !in 1 until 3 != !range0.contains(element7)) throw AssertionError() + if (!(element7 in 1 until 3) != !range0.contains(element7)) throw AssertionError() + if (!(element7 !in 1 until 3) != range0.contains(element7)) throw AssertionError() +} + +fun testR0xE8() { + // with possible local optimizations + if (0 in 1 until 3 != range0.contains(0)) throw AssertionError() + if (0 !in 1 until 3 != !range0.contains(0)) throw AssertionError() + if (!(0 in 1 until 3) != !range0.contains(0)) throw AssertionError() + if (!(0 !in 1 until 3) != range0.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in 1 until 3 != range0.contains(element8)) throw AssertionError() + if (element8 !in 1 until 3 != !range0.contains(element8)) throw AssertionError() + if (!(element8 in 1 until 3) != !range0.contains(element8)) throw AssertionError() + if (!(element8 !in 1 until 3) != range0.contains(element8)) throw AssertionError() +} + +fun testR0xE9() { + // with possible local optimizations + if (0.toLong() in 1 until 3 != range0.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in 1 until 3 != !range0.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in 1 until 3) != !range0.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in 1 until 3) != range0.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in 1 until 3 != range0.contains(element9)) throw AssertionError() + if (element9 !in 1 until 3 != !range0.contains(element9)) throw AssertionError() + if (!(element9 in 1 until 3) != !range0.contains(element9)) throw AssertionError() + if (!(element9 !in 1 until 3) != range0.contains(element9)) throw AssertionError() +} + +fun testR0xE10() { + // with possible local optimizations + if (0.toFloat() in 1 until 3 != range0.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in 1 until 3 != !range0.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in 1 until 3) != !range0.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in 1 until 3) != range0.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in 1 until 3 != range0.contains(element10)) throw AssertionError() + if (element10 !in 1 until 3 != !range0.contains(element10)) throw AssertionError() + if (!(element10 in 1 until 3) != !range0.contains(element10)) throw AssertionError() + if (!(element10 !in 1 until 3) != range0.contains(element10)) throw AssertionError() +} + +fun testR0xE11() { + // with possible local optimizations + if (0.toDouble() in 1 until 3 != range0.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in 1 until 3 != !range0.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in 1 until 3) != !range0.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in 1 until 3) != range0.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in 1 until 3 != range0.contains(element11)) throw AssertionError() + if (element11 !in 1 until 3 != !range0.contains(element11)) throw AssertionError() + if (!(element11 in 1 until 3) != !range0.contains(element11)) throw AssertionError() + if (!(element11 !in 1 until 3) != range0.contains(element11)) throw AssertionError() +} + +fun testR0xE12() { + // with possible local optimizations + if (1.toByte() in 1 until 3 != range0.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 1 until 3 != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 1 until 3) != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 1 until 3) != range0.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 1 until 3 != range0.contains(element12)) throw AssertionError() + if (element12 !in 1 until 3 != !range0.contains(element12)) throw AssertionError() + if (!(element12 in 1 until 3) != !range0.contains(element12)) throw AssertionError() + if (!(element12 !in 1 until 3) != range0.contains(element12)) throw AssertionError() +} + +fun testR0xE13() { + // with possible local optimizations + if (1.toShort() in 1 until 3 != range0.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 1 until 3 != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 1 until 3) != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 1 until 3) != range0.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 1 until 3 != range0.contains(element13)) throw AssertionError() + if (element13 !in 1 until 3 != !range0.contains(element13)) throw AssertionError() + if (!(element13 in 1 until 3) != !range0.contains(element13)) throw AssertionError() + if (!(element13 !in 1 until 3) != range0.contains(element13)) throw AssertionError() +} + +fun testR0xE14() { + // with possible local optimizations + if (1 in 1 until 3 != range0.contains(1)) throw AssertionError() + if (1 !in 1 until 3 != !range0.contains(1)) throw AssertionError() + if (!(1 in 1 until 3) != !range0.contains(1)) throw AssertionError() + if (!(1 !in 1 until 3) != range0.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in 1 until 3 != range0.contains(element14)) throw AssertionError() + if (element14 !in 1 until 3 != !range0.contains(element14)) throw AssertionError() + if (!(element14 in 1 until 3) != !range0.contains(element14)) throw AssertionError() + if (!(element14 !in 1 until 3) != range0.contains(element14)) throw AssertionError() +} + +fun testR0xE15() { + // with possible local optimizations + if (1.toLong() in 1 until 3 != range0.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in 1 until 3 != !range0.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in 1 until 3) != !range0.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in 1 until 3) != range0.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in 1 until 3 != range0.contains(element15)) throw AssertionError() + if (element15 !in 1 until 3 != !range0.contains(element15)) throw AssertionError() + if (!(element15 in 1 until 3) != !range0.contains(element15)) throw AssertionError() + if (!(element15 !in 1 until 3) != range0.contains(element15)) throw AssertionError() +} + +fun testR0xE16() { + // with possible local optimizations + if (1.toFloat() in 1 until 3 != range0.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in 1 until 3 != !range0.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in 1 until 3) != !range0.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in 1 until 3) != range0.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in 1 until 3 != range0.contains(element16)) throw AssertionError() + if (element16 !in 1 until 3 != !range0.contains(element16)) throw AssertionError() + if (!(element16 in 1 until 3) != !range0.contains(element16)) throw AssertionError() + if (!(element16 !in 1 until 3) != range0.contains(element16)) throw AssertionError() +} + +fun testR0xE17() { + // with possible local optimizations + if (1.toDouble() in 1 until 3 != range0.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in 1 until 3 != !range0.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in 1 until 3) != !range0.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in 1 until 3) != range0.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in 1 until 3 != range0.contains(element17)) throw AssertionError() + if (element17 !in 1 until 3 != !range0.contains(element17)) throw AssertionError() + if (!(element17 in 1 until 3) != !range0.contains(element17)) throw AssertionError() + if (!(element17 !in 1 until 3) != range0.contains(element17)) throw AssertionError() +} + +fun testR0xE18() { + // with possible local optimizations + if (2.toByte() in 1 until 3 != range0.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 1 until 3 != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 1 until 3) != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 1 until 3) != range0.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in 1 until 3 != range0.contains(element18)) throw AssertionError() + if (element18 !in 1 until 3 != !range0.contains(element18)) throw AssertionError() + if (!(element18 in 1 until 3) != !range0.contains(element18)) throw AssertionError() + if (!(element18 !in 1 until 3) != range0.contains(element18)) throw AssertionError() +} + +fun testR0xE19() { + // with possible local optimizations + if (2.toShort() in 1 until 3 != range0.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 1 until 3 != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 1 until 3) != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 1 until 3) != range0.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in 1 until 3 != range0.contains(element19)) throw AssertionError() + if (element19 !in 1 until 3 != !range0.contains(element19)) throw AssertionError() + if (!(element19 in 1 until 3) != !range0.contains(element19)) throw AssertionError() + if (!(element19 !in 1 until 3) != range0.contains(element19)) throw AssertionError() +} + +fun testR0xE20() { + // with possible local optimizations + if (2 in 1 until 3 != range0.contains(2)) throw AssertionError() + if (2 !in 1 until 3 != !range0.contains(2)) throw AssertionError() + if (!(2 in 1 until 3) != !range0.contains(2)) throw AssertionError() + if (!(2 !in 1 until 3) != range0.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in 1 until 3 != range0.contains(element20)) throw AssertionError() + if (element20 !in 1 until 3 != !range0.contains(element20)) throw AssertionError() + if (!(element20 in 1 until 3) != !range0.contains(element20)) throw AssertionError() + if (!(element20 !in 1 until 3) != range0.contains(element20)) throw AssertionError() +} + +fun testR0xE21() { + // with possible local optimizations + if (2.toLong() in 1 until 3 != range0.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in 1 until 3 != !range0.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in 1 until 3) != !range0.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in 1 until 3) != range0.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in 1 until 3 != range0.contains(element21)) throw AssertionError() + if (element21 !in 1 until 3 != !range0.contains(element21)) throw AssertionError() + if (!(element21 in 1 until 3) != !range0.contains(element21)) throw AssertionError() + if (!(element21 !in 1 until 3) != range0.contains(element21)) throw AssertionError() +} + +fun testR0xE22() { + // with possible local optimizations + if (2.toFloat() in 1 until 3 != range0.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in 1 until 3 != !range0.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in 1 until 3) != !range0.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in 1 until 3) != range0.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in 1 until 3 != range0.contains(element22)) throw AssertionError() + if (element22 !in 1 until 3 != !range0.contains(element22)) throw AssertionError() + if (!(element22 in 1 until 3) != !range0.contains(element22)) throw AssertionError() + if (!(element22 !in 1 until 3) != range0.contains(element22)) throw AssertionError() +} + +fun testR0xE23() { + // with possible local optimizations + if (2.toDouble() in 1 until 3 != range0.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in 1 until 3 != !range0.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in 1 until 3) != !range0.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in 1 until 3) != range0.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in 1 until 3 != range0.contains(element23)) throw AssertionError() + if (element23 !in 1 until 3 != !range0.contains(element23)) throw AssertionError() + if (!(element23 in 1 until 3) != !range0.contains(element23)) throw AssertionError() + if (!(element23 !in 1 until 3) != range0.contains(element23)) throw AssertionError() +} + +fun testR0xE24() { + // with possible local optimizations + if (3.toByte() in 1 until 3 != range0.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 1 until 3 != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 1 until 3) != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 1 until 3) != range0.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in 1 until 3 != range0.contains(element24)) throw AssertionError() + if (element24 !in 1 until 3 != !range0.contains(element24)) throw AssertionError() + if (!(element24 in 1 until 3) != !range0.contains(element24)) throw AssertionError() + if (!(element24 !in 1 until 3) != range0.contains(element24)) throw AssertionError() +} + +fun testR0xE25() { + // with possible local optimizations + if (3.toShort() in 1 until 3 != range0.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 1 until 3 != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 1 until 3) != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 1 until 3) != range0.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in 1 until 3 != range0.contains(element25)) throw AssertionError() + if (element25 !in 1 until 3 != !range0.contains(element25)) throw AssertionError() + if (!(element25 in 1 until 3) != !range0.contains(element25)) throw AssertionError() + if (!(element25 !in 1 until 3) != range0.contains(element25)) throw AssertionError() +} + +fun testR0xE26() { + // with possible local optimizations + if (3 in 1 until 3 != range0.contains(3)) throw AssertionError() + if (3 !in 1 until 3 != !range0.contains(3)) throw AssertionError() + if (!(3 in 1 until 3) != !range0.contains(3)) throw AssertionError() + if (!(3 !in 1 until 3) != range0.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in 1 until 3 != range0.contains(element26)) throw AssertionError() + if (element26 !in 1 until 3 != !range0.contains(element26)) throw AssertionError() + if (!(element26 in 1 until 3) != !range0.contains(element26)) throw AssertionError() + if (!(element26 !in 1 until 3) != range0.contains(element26)) throw AssertionError() +} + +fun testR0xE27() { + // with possible local optimizations + if (3.toLong() in 1 until 3 != range0.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in 1 until 3 != !range0.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in 1 until 3) != !range0.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in 1 until 3) != range0.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in 1 until 3 != range0.contains(element27)) throw AssertionError() + if (element27 !in 1 until 3 != !range0.contains(element27)) throw AssertionError() + if (!(element27 in 1 until 3) != !range0.contains(element27)) throw AssertionError() + if (!(element27 !in 1 until 3) != range0.contains(element27)) throw AssertionError() +} + +fun testR0xE28() { + // with possible local optimizations + if (3.toFloat() in 1 until 3 != range0.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in 1 until 3 != !range0.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in 1 until 3) != !range0.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in 1 until 3) != range0.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in 1 until 3 != range0.contains(element28)) throw AssertionError() + if (element28 !in 1 until 3 != !range0.contains(element28)) throw AssertionError() + if (!(element28 in 1 until 3) != !range0.contains(element28)) throw AssertionError() + if (!(element28 !in 1 until 3) != range0.contains(element28)) throw AssertionError() +} + +fun testR0xE29() { + // with possible local optimizations + if (3.toDouble() in 1 until 3 != range0.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in 1 until 3 != !range0.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in 1 until 3) != !range0.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in 1 until 3) != range0.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in 1 until 3 != range0.contains(element29)) throw AssertionError() + if (element29 !in 1 until 3 != !range0.contains(element29)) throw AssertionError() + if (!(element29 in 1 until 3) != !range0.contains(element29)) throw AssertionError() + if (!(element29 !in 1 until 3) != range0.contains(element29)) throw AssertionError() +} + +fun testR0xE30() { + // with possible local optimizations + if (4.toByte() in 1 until 3 != range0.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 1 until 3 != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 1 until 3) != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 1 until 3) != range0.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in 1 until 3 != range0.contains(element30)) throw AssertionError() + if (element30 !in 1 until 3 != !range0.contains(element30)) throw AssertionError() + if (!(element30 in 1 until 3) != !range0.contains(element30)) throw AssertionError() + if (!(element30 !in 1 until 3) != range0.contains(element30)) throw AssertionError() +} + +fun testR0xE31() { + // with possible local optimizations + if (4.toShort() in 1 until 3 != range0.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 1 until 3 != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 1 until 3) != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 1 until 3) != range0.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in 1 until 3 != range0.contains(element31)) throw AssertionError() + if (element31 !in 1 until 3 != !range0.contains(element31)) throw AssertionError() + if (!(element31 in 1 until 3) != !range0.contains(element31)) throw AssertionError() + if (!(element31 !in 1 until 3) != range0.contains(element31)) throw AssertionError() +} + +fun testR0xE32() { + // with possible local optimizations + if (4 in 1 until 3 != range0.contains(4)) throw AssertionError() + if (4 !in 1 until 3 != !range0.contains(4)) throw AssertionError() + if (!(4 in 1 until 3) != !range0.contains(4)) throw AssertionError() + if (!(4 !in 1 until 3) != range0.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in 1 until 3 != range0.contains(element32)) throw AssertionError() + if (element32 !in 1 until 3 != !range0.contains(element32)) throw AssertionError() + if (!(element32 in 1 until 3) != !range0.contains(element32)) throw AssertionError() + if (!(element32 !in 1 until 3) != range0.contains(element32)) throw AssertionError() +} + +fun testR0xE33() { + // with possible local optimizations + if (4.toLong() in 1 until 3 != range0.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in 1 until 3 != !range0.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in 1 until 3) != !range0.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in 1 until 3) != range0.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in 1 until 3 != range0.contains(element33)) throw AssertionError() + if (element33 !in 1 until 3 != !range0.contains(element33)) throw AssertionError() + if (!(element33 in 1 until 3) != !range0.contains(element33)) throw AssertionError() + if (!(element33 !in 1 until 3) != range0.contains(element33)) throw AssertionError() +} + +fun testR0xE34() { + // with possible local optimizations + if (4.toFloat() in 1 until 3 != range0.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in 1 until 3 != !range0.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in 1 until 3) != !range0.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in 1 until 3) != range0.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in 1 until 3 != range0.contains(element34)) throw AssertionError() + if (element34 !in 1 until 3 != !range0.contains(element34)) throw AssertionError() + if (!(element34 in 1 until 3) != !range0.contains(element34)) throw AssertionError() + if (!(element34 !in 1 until 3) != range0.contains(element34)) throw AssertionError() +} + +fun testR0xE35() { + // with possible local optimizations + if (4.toDouble() in 1 until 3 != range0.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in 1 until 3 != !range0.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in 1 until 3) != !range0.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in 1 until 3) != range0.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in 1 until 3 != range0.contains(element35)) throw AssertionError() + if (element35 !in 1 until 3 != !range0.contains(element35)) throw AssertionError() + if (!(element35 in 1 until 3) != !range0.contains(element35)) throw AssertionError() + if (!(element35 !in 1 until 3) != range0.contains(element35)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if ((-1).toByte() in 3 until 1 != range1.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 3 until 1 != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 3 until 1) != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 3 until 1) != range1.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 3 until 1 != range1.contains(element0)) throw AssertionError() + if (element0 !in 3 until 1 != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3 until 1) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3 until 1) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if ((-1).toShort() in 3 until 1 != range1.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 3 until 1 != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 3 until 1) != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 3 until 1) != range1.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 3 until 1 != range1.contains(element1)) throw AssertionError() + if (element1 !in 3 until 1 != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3 until 1) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3 until 1) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if ((-1) in 3 until 1 != range1.contains((-1))) throw AssertionError() + if ((-1) !in 3 until 1 != !range1.contains((-1))) throw AssertionError() + if (!((-1) in 3 until 1) != !range1.contains((-1))) throw AssertionError() + if (!((-1) !in 3 until 1) != range1.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in 3 until 1 != range1.contains(element2)) throw AssertionError() + if (element2 !in 3 until 1 != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3 until 1) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3 until 1) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if ((-1).toLong() in 3 until 1 != range1.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in 3 until 1 != !range1.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in 3 until 1) != !range1.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in 3 until 1) != range1.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in 3 until 1 != range1.contains(element3)) throw AssertionError() + if (element3 !in 3 until 1 != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3 until 1) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3 until 1) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if ((-1).toFloat() in 3 until 1 != range1.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in 3 until 1 != !range1.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in 3 until 1) != !range1.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in 3 until 1) != range1.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in 3 until 1 != range1.contains(element4)) throw AssertionError() + if (element4 !in 3 until 1 != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3 until 1) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3 until 1) != range1.contains(element4)) throw AssertionError() +} + +fun testR1xE5() { + // with possible local optimizations + if ((-1).toDouble() in 3 until 1 != range1.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in 3 until 1 != !range1.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in 3 until 1) != !range1.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in 3 until 1) != range1.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in 3 until 1 != range1.contains(element5)) throw AssertionError() + if (element5 !in 3 until 1 != !range1.contains(element5)) throw AssertionError() + if (!(element5 in 3 until 1) != !range1.contains(element5)) throw AssertionError() + if (!(element5 !in 3 until 1) != range1.contains(element5)) throw AssertionError() +} + +fun testR1xE6() { + // with possible local optimizations + if (0.toByte() in 3 until 1 != range1.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 3 until 1 != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 3 until 1) != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 3 until 1) != range1.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in 3 until 1 != range1.contains(element6)) throw AssertionError() + if (element6 !in 3 until 1 != !range1.contains(element6)) throw AssertionError() + if (!(element6 in 3 until 1) != !range1.contains(element6)) throw AssertionError() + if (!(element6 !in 3 until 1) != range1.contains(element6)) throw AssertionError() +} + +fun testR1xE7() { + // with possible local optimizations + if (0.toShort() in 3 until 1 != range1.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 3 until 1 != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 3 until 1) != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 3 until 1) != range1.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in 3 until 1 != range1.contains(element7)) throw AssertionError() + if (element7 !in 3 until 1 != !range1.contains(element7)) throw AssertionError() + if (!(element7 in 3 until 1) != !range1.contains(element7)) throw AssertionError() + if (!(element7 !in 3 until 1) != range1.contains(element7)) throw AssertionError() +} + +fun testR1xE8() { + // with possible local optimizations + if (0 in 3 until 1 != range1.contains(0)) throw AssertionError() + if (0 !in 3 until 1 != !range1.contains(0)) throw AssertionError() + if (!(0 in 3 until 1) != !range1.contains(0)) throw AssertionError() + if (!(0 !in 3 until 1) != range1.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in 3 until 1 != range1.contains(element8)) throw AssertionError() + if (element8 !in 3 until 1 != !range1.contains(element8)) throw AssertionError() + if (!(element8 in 3 until 1) != !range1.contains(element8)) throw AssertionError() + if (!(element8 !in 3 until 1) != range1.contains(element8)) throw AssertionError() +} + +fun testR1xE9() { + // with possible local optimizations + if (0.toLong() in 3 until 1 != range1.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in 3 until 1 != !range1.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in 3 until 1) != !range1.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in 3 until 1) != range1.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in 3 until 1 != range1.contains(element9)) throw AssertionError() + if (element9 !in 3 until 1 != !range1.contains(element9)) throw AssertionError() + if (!(element9 in 3 until 1) != !range1.contains(element9)) throw AssertionError() + if (!(element9 !in 3 until 1) != range1.contains(element9)) throw AssertionError() +} + +fun testR1xE10() { + // with possible local optimizations + if (0.toFloat() in 3 until 1 != range1.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in 3 until 1 != !range1.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in 3 until 1) != !range1.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in 3 until 1) != range1.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in 3 until 1 != range1.contains(element10)) throw AssertionError() + if (element10 !in 3 until 1 != !range1.contains(element10)) throw AssertionError() + if (!(element10 in 3 until 1) != !range1.contains(element10)) throw AssertionError() + if (!(element10 !in 3 until 1) != range1.contains(element10)) throw AssertionError() +} + +fun testR1xE11() { + // with possible local optimizations + if (0.toDouble() in 3 until 1 != range1.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in 3 until 1 != !range1.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in 3 until 1) != !range1.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in 3 until 1) != range1.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in 3 until 1 != range1.contains(element11)) throw AssertionError() + if (element11 !in 3 until 1 != !range1.contains(element11)) throw AssertionError() + if (!(element11 in 3 until 1) != !range1.contains(element11)) throw AssertionError() + if (!(element11 !in 3 until 1) != range1.contains(element11)) throw AssertionError() +} + +fun testR1xE12() { + // with possible local optimizations + if (1.toByte() in 3 until 1 != range1.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 3 until 1 != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 3 until 1) != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 3 until 1) != range1.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 3 until 1 != range1.contains(element12)) throw AssertionError() + if (element12 !in 3 until 1 != !range1.contains(element12)) throw AssertionError() + if (!(element12 in 3 until 1) != !range1.contains(element12)) throw AssertionError() + if (!(element12 !in 3 until 1) != range1.contains(element12)) throw AssertionError() +} + +fun testR1xE13() { + // with possible local optimizations + if (1.toShort() in 3 until 1 != range1.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 3 until 1 != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 3 until 1) != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 3 until 1) != range1.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 3 until 1 != range1.contains(element13)) throw AssertionError() + if (element13 !in 3 until 1 != !range1.contains(element13)) throw AssertionError() + if (!(element13 in 3 until 1) != !range1.contains(element13)) throw AssertionError() + if (!(element13 !in 3 until 1) != range1.contains(element13)) throw AssertionError() +} + +fun testR1xE14() { + // with possible local optimizations + if (1 in 3 until 1 != range1.contains(1)) throw AssertionError() + if (1 !in 3 until 1 != !range1.contains(1)) throw AssertionError() + if (!(1 in 3 until 1) != !range1.contains(1)) throw AssertionError() + if (!(1 !in 3 until 1) != range1.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in 3 until 1 != range1.contains(element14)) throw AssertionError() + if (element14 !in 3 until 1 != !range1.contains(element14)) throw AssertionError() + if (!(element14 in 3 until 1) != !range1.contains(element14)) throw AssertionError() + if (!(element14 !in 3 until 1) != range1.contains(element14)) throw AssertionError() +} + +fun testR1xE15() { + // with possible local optimizations + if (1.toLong() in 3 until 1 != range1.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in 3 until 1 != !range1.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in 3 until 1) != !range1.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in 3 until 1) != range1.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in 3 until 1 != range1.contains(element15)) throw AssertionError() + if (element15 !in 3 until 1 != !range1.contains(element15)) throw AssertionError() + if (!(element15 in 3 until 1) != !range1.contains(element15)) throw AssertionError() + if (!(element15 !in 3 until 1) != range1.contains(element15)) throw AssertionError() +} + +fun testR1xE16() { + // with possible local optimizations + if (1.toFloat() in 3 until 1 != range1.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in 3 until 1 != !range1.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in 3 until 1) != !range1.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in 3 until 1) != range1.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in 3 until 1 != range1.contains(element16)) throw AssertionError() + if (element16 !in 3 until 1 != !range1.contains(element16)) throw AssertionError() + if (!(element16 in 3 until 1) != !range1.contains(element16)) throw AssertionError() + if (!(element16 !in 3 until 1) != range1.contains(element16)) throw AssertionError() +} + +fun testR1xE17() { + // with possible local optimizations + if (1.toDouble() in 3 until 1 != range1.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in 3 until 1 != !range1.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in 3 until 1) != !range1.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in 3 until 1) != range1.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in 3 until 1 != range1.contains(element17)) throw AssertionError() + if (element17 !in 3 until 1 != !range1.contains(element17)) throw AssertionError() + if (!(element17 in 3 until 1) != !range1.contains(element17)) throw AssertionError() + if (!(element17 !in 3 until 1) != range1.contains(element17)) throw AssertionError() +} + +fun testR1xE18() { + // with possible local optimizations + if (2.toByte() in 3 until 1 != range1.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 3 until 1 != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 3 until 1) != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 3 until 1) != range1.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in 3 until 1 != range1.contains(element18)) throw AssertionError() + if (element18 !in 3 until 1 != !range1.contains(element18)) throw AssertionError() + if (!(element18 in 3 until 1) != !range1.contains(element18)) throw AssertionError() + if (!(element18 !in 3 until 1) != range1.contains(element18)) throw AssertionError() +} + +fun testR1xE19() { + // with possible local optimizations + if (2.toShort() in 3 until 1 != range1.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 3 until 1 != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 3 until 1) != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 3 until 1) != range1.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in 3 until 1 != range1.contains(element19)) throw AssertionError() + if (element19 !in 3 until 1 != !range1.contains(element19)) throw AssertionError() + if (!(element19 in 3 until 1) != !range1.contains(element19)) throw AssertionError() + if (!(element19 !in 3 until 1) != range1.contains(element19)) throw AssertionError() +} + +fun testR1xE20() { + // with possible local optimizations + if (2 in 3 until 1 != range1.contains(2)) throw AssertionError() + if (2 !in 3 until 1 != !range1.contains(2)) throw AssertionError() + if (!(2 in 3 until 1) != !range1.contains(2)) throw AssertionError() + if (!(2 !in 3 until 1) != range1.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in 3 until 1 != range1.contains(element20)) throw AssertionError() + if (element20 !in 3 until 1 != !range1.contains(element20)) throw AssertionError() + if (!(element20 in 3 until 1) != !range1.contains(element20)) throw AssertionError() + if (!(element20 !in 3 until 1) != range1.contains(element20)) throw AssertionError() +} + +fun testR1xE21() { + // with possible local optimizations + if (2.toLong() in 3 until 1 != range1.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in 3 until 1 != !range1.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in 3 until 1) != !range1.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in 3 until 1) != range1.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in 3 until 1 != range1.contains(element21)) throw AssertionError() + if (element21 !in 3 until 1 != !range1.contains(element21)) throw AssertionError() + if (!(element21 in 3 until 1) != !range1.contains(element21)) throw AssertionError() + if (!(element21 !in 3 until 1) != range1.contains(element21)) throw AssertionError() +} + +fun testR1xE22() { + // with possible local optimizations + if (2.toFloat() in 3 until 1 != range1.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in 3 until 1 != !range1.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in 3 until 1) != !range1.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in 3 until 1) != range1.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in 3 until 1 != range1.contains(element22)) throw AssertionError() + if (element22 !in 3 until 1 != !range1.contains(element22)) throw AssertionError() + if (!(element22 in 3 until 1) != !range1.contains(element22)) throw AssertionError() + if (!(element22 !in 3 until 1) != range1.contains(element22)) throw AssertionError() +} + +fun testR1xE23() { + // with possible local optimizations + if (2.toDouble() in 3 until 1 != range1.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in 3 until 1 != !range1.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in 3 until 1) != !range1.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in 3 until 1) != range1.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in 3 until 1 != range1.contains(element23)) throw AssertionError() + if (element23 !in 3 until 1 != !range1.contains(element23)) throw AssertionError() + if (!(element23 in 3 until 1) != !range1.contains(element23)) throw AssertionError() + if (!(element23 !in 3 until 1) != range1.contains(element23)) throw AssertionError() +} + +fun testR1xE24() { + // with possible local optimizations + if (3.toByte() in 3 until 1 != range1.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 3 until 1 != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 3 until 1) != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 3 until 1) != range1.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in 3 until 1 != range1.contains(element24)) throw AssertionError() + if (element24 !in 3 until 1 != !range1.contains(element24)) throw AssertionError() + if (!(element24 in 3 until 1) != !range1.contains(element24)) throw AssertionError() + if (!(element24 !in 3 until 1) != range1.contains(element24)) throw AssertionError() +} + +fun testR1xE25() { + // with possible local optimizations + if (3.toShort() in 3 until 1 != range1.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 3 until 1 != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 3 until 1) != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 3 until 1) != range1.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in 3 until 1 != range1.contains(element25)) throw AssertionError() + if (element25 !in 3 until 1 != !range1.contains(element25)) throw AssertionError() + if (!(element25 in 3 until 1) != !range1.contains(element25)) throw AssertionError() + if (!(element25 !in 3 until 1) != range1.contains(element25)) throw AssertionError() +} + +fun testR1xE26() { + // with possible local optimizations + if (3 in 3 until 1 != range1.contains(3)) throw AssertionError() + if (3 !in 3 until 1 != !range1.contains(3)) throw AssertionError() + if (!(3 in 3 until 1) != !range1.contains(3)) throw AssertionError() + if (!(3 !in 3 until 1) != range1.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in 3 until 1 != range1.contains(element26)) throw AssertionError() + if (element26 !in 3 until 1 != !range1.contains(element26)) throw AssertionError() + if (!(element26 in 3 until 1) != !range1.contains(element26)) throw AssertionError() + if (!(element26 !in 3 until 1) != range1.contains(element26)) throw AssertionError() +} + +fun testR1xE27() { + // with possible local optimizations + if (3.toLong() in 3 until 1 != range1.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in 3 until 1 != !range1.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in 3 until 1) != !range1.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in 3 until 1) != range1.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in 3 until 1 != range1.contains(element27)) throw AssertionError() + if (element27 !in 3 until 1 != !range1.contains(element27)) throw AssertionError() + if (!(element27 in 3 until 1) != !range1.contains(element27)) throw AssertionError() + if (!(element27 !in 3 until 1) != range1.contains(element27)) throw AssertionError() +} + +fun testR1xE28() { + // with possible local optimizations + if (3.toFloat() in 3 until 1 != range1.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in 3 until 1 != !range1.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in 3 until 1) != !range1.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in 3 until 1) != range1.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in 3 until 1 != range1.contains(element28)) throw AssertionError() + if (element28 !in 3 until 1 != !range1.contains(element28)) throw AssertionError() + if (!(element28 in 3 until 1) != !range1.contains(element28)) throw AssertionError() + if (!(element28 !in 3 until 1) != range1.contains(element28)) throw AssertionError() +} + +fun testR1xE29() { + // with possible local optimizations + if (3.toDouble() in 3 until 1 != range1.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in 3 until 1 != !range1.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in 3 until 1) != !range1.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in 3 until 1) != range1.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in 3 until 1 != range1.contains(element29)) throw AssertionError() + if (element29 !in 3 until 1 != !range1.contains(element29)) throw AssertionError() + if (!(element29 in 3 until 1) != !range1.contains(element29)) throw AssertionError() + if (!(element29 !in 3 until 1) != range1.contains(element29)) throw AssertionError() +} + +fun testR1xE30() { + // with possible local optimizations + if (4.toByte() in 3 until 1 != range1.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 3 until 1 != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 3 until 1) != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 3 until 1) != range1.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in 3 until 1 != range1.contains(element30)) throw AssertionError() + if (element30 !in 3 until 1 != !range1.contains(element30)) throw AssertionError() + if (!(element30 in 3 until 1) != !range1.contains(element30)) throw AssertionError() + if (!(element30 !in 3 until 1) != range1.contains(element30)) throw AssertionError() +} + +fun testR1xE31() { + // with possible local optimizations + if (4.toShort() in 3 until 1 != range1.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 3 until 1 != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 3 until 1) != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 3 until 1) != range1.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in 3 until 1 != range1.contains(element31)) throw AssertionError() + if (element31 !in 3 until 1 != !range1.contains(element31)) throw AssertionError() + if (!(element31 in 3 until 1) != !range1.contains(element31)) throw AssertionError() + if (!(element31 !in 3 until 1) != range1.contains(element31)) throw AssertionError() +} + +fun testR1xE32() { + // with possible local optimizations + if (4 in 3 until 1 != range1.contains(4)) throw AssertionError() + if (4 !in 3 until 1 != !range1.contains(4)) throw AssertionError() + if (!(4 in 3 until 1) != !range1.contains(4)) throw AssertionError() + if (!(4 !in 3 until 1) != range1.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in 3 until 1 != range1.contains(element32)) throw AssertionError() + if (element32 !in 3 until 1 != !range1.contains(element32)) throw AssertionError() + if (!(element32 in 3 until 1) != !range1.contains(element32)) throw AssertionError() + if (!(element32 !in 3 until 1) != range1.contains(element32)) throw AssertionError() +} + +fun testR1xE33() { + // with possible local optimizations + if (4.toLong() in 3 until 1 != range1.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in 3 until 1 != !range1.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in 3 until 1) != !range1.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in 3 until 1) != range1.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in 3 until 1 != range1.contains(element33)) throw AssertionError() + if (element33 !in 3 until 1 != !range1.contains(element33)) throw AssertionError() + if (!(element33 in 3 until 1) != !range1.contains(element33)) throw AssertionError() + if (!(element33 !in 3 until 1) != range1.contains(element33)) throw AssertionError() +} + +fun testR1xE34() { + // with possible local optimizations + if (4.toFloat() in 3 until 1 != range1.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in 3 until 1 != !range1.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in 3 until 1) != !range1.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in 3 until 1) != range1.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in 3 until 1 != range1.contains(element34)) throw AssertionError() + if (element34 !in 3 until 1 != !range1.contains(element34)) throw AssertionError() + if (!(element34 in 3 until 1) != !range1.contains(element34)) throw AssertionError() + if (!(element34 !in 3 until 1) != range1.contains(element34)) throw AssertionError() +} + +fun testR1xE35() { + // with possible local optimizations + if (4.toDouble() in 3 until 1 != range1.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in 3 until 1 != !range1.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in 3 until 1) != !range1.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in 3 until 1) != range1.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in 3 until 1 != range1.contains(element35)) throw AssertionError() + if (element35 !in 3 until 1 != !range1.contains(element35)) throw AssertionError() + if (!(element35 in 3 until 1) != !range1.contains(element35)) throw AssertionError() + if (!(element35 !in 3 until 1) != range1.contains(element35)) throw AssertionError() +} + + diff --git a/backend.native/tests/external/codegen/box/ranges/contains/generated/longDownTo.kt b/backend.native/tests/external/codegen/box/ranges/contains/generated/longDownTo.kt new file mode 100644 index 00000000000..46a94bf7c1f --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/generated/longDownTo.kt @@ -0,0 +1,43 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_RUNTIME + + + +val range0 = 3L downTo 1L +val range1 = 1L downTo 3L + +val element0 = 1L + +fun box(): String { + testR0xE0() + testR1xE0() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if (1L in 3L downTo 1L != range0.contains(1L)) throw AssertionError() + if (1L !in 3L downTo 1L != !range0.contains(1L)) throw AssertionError() + if (!(1L in 3L downTo 1L) != !range0.contains(1L)) throw AssertionError() + if (!(1L !in 3L downTo 1L) != range0.contains(1L)) throw AssertionError() + // no local optimizations + if (element0 in 3L downTo 1L != range0.contains(element0)) throw AssertionError() + if (element0 !in 3L downTo 1L != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 3L downTo 1L) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 3L downTo 1L) != range0.contains(element0)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if (1L in 1L downTo 3L != range1.contains(1L)) throw AssertionError() + if (1L !in 1L downTo 3L != !range1.contains(1L)) throw AssertionError() + if (!(1L in 1L downTo 3L) != !range1.contains(1L)) throw AssertionError() + if (!(1L !in 1L downTo 3L) != range1.contains(1L)) throw AssertionError() + // no local optimizations + if (element0 in 1L downTo 3L != range1.contains(element0)) throw AssertionError() + if (element0 !in 1L downTo 3L != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 1L downTo 3L) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 1L downTo 3L) != range1.contains(element0)) throw AssertionError() +} + + diff --git a/backend.native/tests/external/codegen/box/ranges/contains/generated/longRangeLiteral.kt b/backend.native/tests/external/codegen/box/ranges/contains/generated/longRangeLiteral.kt new file mode 100644 index 00000000000..2d31e154f78 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/generated/longRangeLiteral.kt @@ -0,0 +1,1058 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_RUNTIME + + + +val range0 = 1L .. 3L +val range1 = 3L .. 1L + +val element0 = (-1).toByte() +val element1 = (-1).toShort() +val element2 = (-1) +val element3 = (-1).toLong() +val element4 = (-1).toFloat() +val element5 = (-1).toDouble() +val element6 = 0.toByte() +val element7 = 0.toShort() +val element8 = 0 +val element9 = 0.toLong() +val element10 = 0.toFloat() +val element11 = 0.toDouble() +val element12 = 1.toByte() +val element13 = 1.toShort() +val element14 = 1 +val element15 = 1.toLong() +val element16 = 1.toFloat() +val element17 = 1.toDouble() +val element18 = 2.toByte() +val element19 = 2.toShort() +val element20 = 2 +val element21 = 2.toLong() +val element22 = 2.toFloat() +val element23 = 2.toDouble() +val element24 = 3.toByte() +val element25 = 3.toShort() +val element26 = 3 +val element27 = 3.toLong() +val element28 = 3.toFloat() +val element29 = 3.toDouble() +val element30 = 4.toByte() +val element31 = 4.toShort() +val element32 = 4 +val element33 = 4.toLong() +val element34 = 4.toFloat() +val element35 = 4.toDouble() + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR0xE5() + testR0xE6() + testR0xE7() + testR0xE8() + testR0xE9() + testR0xE10() + testR0xE11() + testR0xE12() + testR0xE13() + testR0xE14() + testR0xE15() + testR0xE16() + testR0xE17() + testR0xE18() + testR0xE19() + testR0xE20() + testR0xE21() + testR0xE22() + testR0xE23() + testR0xE24() + testR0xE25() + testR0xE26() + testR0xE27() + testR0xE28() + testR0xE29() + testR0xE30() + testR0xE31() + testR0xE32() + testR0xE33() + testR0xE34() + testR0xE35() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + testR1xE5() + testR1xE6() + testR1xE7() + testR1xE8() + testR1xE9() + testR1xE10() + testR1xE11() + testR1xE12() + testR1xE13() + testR1xE14() + testR1xE15() + testR1xE16() + testR1xE17() + testR1xE18() + testR1xE19() + testR1xE20() + testR1xE21() + testR1xE22() + testR1xE23() + testR1xE24() + testR1xE25() + testR1xE26() + testR1xE27() + testR1xE28() + testR1xE29() + testR1xE30() + testR1xE31() + testR1xE32() + testR1xE33() + testR1xE34() + testR1xE35() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if ((-1).toByte() in 1L .. 3L != range0.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 1L .. 3L != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 1L .. 3L) != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 1L .. 3L) != range0.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 1L .. 3L != range0.contains(element0)) throw AssertionError() + if (element0 !in 1L .. 3L != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1L .. 3L) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1L .. 3L) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if ((-1).toShort() in 1L .. 3L != range0.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 1L .. 3L != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 1L .. 3L) != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 1L .. 3L) != range0.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 1L .. 3L != range0.contains(element1)) throw AssertionError() + if (element1 !in 1L .. 3L != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1L .. 3L) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1L .. 3L) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if ((-1) in 1L .. 3L != range0.contains((-1))) throw AssertionError() + if ((-1) !in 1L .. 3L != !range0.contains((-1))) throw AssertionError() + if (!((-1) in 1L .. 3L) != !range0.contains((-1))) throw AssertionError() + if (!((-1) !in 1L .. 3L) != range0.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in 1L .. 3L != range0.contains(element2)) throw AssertionError() + if (element2 !in 1L .. 3L != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1L .. 3L) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1L .. 3L) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if ((-1).toLong() in 1L .. 3L != range0.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in 1L .. 3L != !range0.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in 1L .. 3L) != !range0.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in 1L .. 3L) != range0.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in 1L .. 3L != range0.contains(element3)) throw AssertionError() + if (element3 !in 1L .. 3L != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1L .. 3L) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1L .. 3L) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if ((-1).toFloat() in 1L .. 3L != range0.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in 1L .. 3L != !range0.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in 1L .. 3L) != !range0.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in 1L .. 3L) != range0.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in 1L .. 3L != range0.contains(element4)) throw AssertionError() + if (element4 !in 1L .. 3L != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1L .. 3L) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1L .. 3L) != range0.contains(element4)) throw AssertionError() +} + +fun testR0xE5() { + // with possible local optimizations + if ((-1).toDouble() in 1L .. 3L != range0.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in 1L .. 3L != !range0.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in 1L .. 3L) != !range0.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in 1L .. 3L) != range0.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in 1L .. 3L != range0.contains(element5)) throw AssertionError() + if (element5 !in 1L .. 3L != !range0.contains(element5)) throw AssertionError() + if (!(element5 in 1L .. 3L) != !range0.contains(element5)) throw AssertionError() + if (!(element5 !in 1L .. 3L) != range0.contains(element5)) throw AssertionError() +} + +fun testR0xE6() { + // with possible local optimizations + if (0.toByte() in 1L .. 3L != range0.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 1L .. 3L != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 1L .. 3L) != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 1L .. 3L) != range0.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in 1L .. 3L != range0.contains(element6)) throw AssertionError() + if (element6 !in 1L .. 3L != !range0.contains(element6)) throw AssertionError() + if (!(element6 in 1L .. 3L) != !range0.contains(element6)) throw AssertionError() + if (!(element6 !in 1L .. 3L) != range0.contains(element6)) throw AssertionError() +} + +fun testR0xE7() { + // with possible local optimizations + if (0.toShort() in 1L .. 3L != range0.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 1L .. 3L != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 1L .. 3L) != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 1L .. 3L) != range0.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in 1L .. 3L != range0.contains(element7)) throw AssertionError() + if (element7 !in 1L .. 3L != !range0.contains(element7)) throw AssertionError() + if (!(element7 in 1L .. 3L) != !range0.contains(element7)) throw AssertionError() + if (!(element7 !in 1L .. 3L) != range0.contains(element7)) throw AssertionError() +} + +fun testR0xE8() { + // with possible local optimizations + if (0 in 1L .. 3L != range0.contains(0)) throw AssertionError() + if (0 !in 1L .. 3L != !range0.contains(0)) throw AssertionError() + if (!(0 in 1L .. 3L) != !range0.contains(0)) throw AssertionError() + if (!(0 !in 1L .. 3L) != range0.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in 1L .. 3L != range0.contains(element8)) throw AssertionError() + if (element8 !in 1L .. 3L != !range0.contains(element8)) throw AssertionError() + if (!(element8 in 1L .. 3L) != !range0.contains(element8)) throw AssertionError() + if (!(element8 !in 1L .. 3L) != range0.contains(element8)) throw AssertionError() +} + +fun testR0xE9() { + // with possible local optimizations + if (0.toLong() in 1L .. 3L != range0.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in 1L .. 3L != !range0.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in 1L .. 3L) != !range0.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in 1L .. 3L) != range0.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in 1L .. 3L != range0.contains(element9)) throw AssertionError() + if (element9 !in 1L .. 3L != !range0.contains(element9)) throw AssertionError() + if (!(element9 in 1L .. 3L) != !range0.contains(element9)) throw AssertionError() + if (!(element9 !in 1L .. 3L) != range0.contains(element9)) throw AssertionError() +} + +fun testR0xE10() { + // with possible local optimizations + if (0.toFloat() in 1L .. 3L != range0.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in 1L .. 3L != !range0.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in 1L .. 3L) != !range0.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in 1L .. 3L) != range0.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in 1L .. 3L != range0.contains(element10)) throw AssertionError() + if (element10 !in 1L .. 3L != !range0.contains(element10)) throw AssertionError() + if (!(element10 in 1L .. 3L) != !range0.contains(element10)) throw AssertionError() + if (!(element10 !in 1L .. 3L) != range0.contains(element10)) throw AssertionError() +} + +fun testR0xE11() { + // with possible local optimizations + if (0.toDouble() in 1L .. 3L != range0.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in 1L .. 3L != !range0.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in 1L .. 3L) != !range0.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in 1L .. 3L) != range0.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in 1L .. 3L != range0.contains(element11)) throw AssertionError() + if (element11 !in 1L .. 3L != !range0.contains(element11)) throw AssertionError() + if (!(element11 in 1L .. 3L) != !range0.contains(element11)) throw AssertionError() + if (!(element11 !in 1L .. 3L) != range0.contains(element11)) throw AssertionError() +} + +fun testR0xE12() { + // with possible local optimizations + if (1.toByte() in 1L .. 3L != range0.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 1L .. 3L != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 1L .. 3L) != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 1L .. 3L) != range0.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 1L .. 3L != range0.contains(element12)) throw AssertionError() + if (element12 !in 1L .. 3L != !range0.contains(element12)) throw AssertionError() + if (!(element12 in 1L .. 3L) != !range0.contains(element12)) throw AssertionError() + if (!(element12 !in 1L .. 3L) != range0.contains(element12)) throw AssertionError() +} + +fun testR0xE13() { + // with possible local optimizations + if (1.toShort() in 1L .. 3L != range0.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 1L .. 3L != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 1L .. 3L) != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 1L .. 3L) != range0.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 1L .. 3L != range0.contains(element13)) throw AssertionError() + if (element13 !in 1L .. 3L != !range0.contains(element13)) throw AssertionError() + if (!(element13 in 1L .. 3L) != !range0.contains(element13)) throw AssertionError() + if (!(element13 !in 1L .. 3L) != range0.contains(element13)) throw AssertionError() +} + +fun testR0xE14() { + // with possible local optimizations + if (1 in 1L .. 3L != range0.contains(1)) throw AssertionError() + if (1 !in 1L .. 3L != !range0.contains(1)) throw AssertionError() + if (!(1 in 1L .. 3L) != !range0.contains(1)) throw AssertionError() + if (!(1 !in 1L .. 3L) != range0.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in 1L .. 3L != range0.contains(element14)) throw AssertionError() + if (element14 !in 1L .. 3L != !range0.contains(element14)) throw AssertionError() + if (!(element14 in 1L .. 3L) != !range0.contains(element14)) throw AssertionError() + if (!(element14 !in 1L .. 3L) != range0.contains(element14)) throw AssertionError() +} + +fun testR0xE15() { + // with possible local optimizations + if (1.toLong() in 1L .. 3L != range0.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in 1L .. 3L != !range0.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in 1L .. 3L) != !range0.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in 1L .. 3L) != range0.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in 1L .. 3L != range0.contains(element15)) throw AssertionError() + if (element15 !in 1L .. 3L != !range0.contains(element15)) throw AssertionError() + if (!(element15 in 1L .. 3L) != !range0.contains(element15)) throw AssertionError() + if (!(element15 !in 1L .. 3L) != range0.contains(element15)) throw AssertionError() +} + +fun testR0xE16() { + // with possible local optimizations + if (1.toFloat() in 1L .. 3L != range0.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in 1L .. 3L != !range0.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in 1L .. 3L) != !range0.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in 1L .. 3L) != range0.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in 1L .. 3L != range0.contains(element16)) throw AssertionError() + if (element16 !in 1L .. 3L != !range0.contains(element16)) throw AssertionError() + if (!(element16 in 1L .. 3L) != !range0.contains(element16)) throw AssertionError() + if (!(element16 !in 1L .. 3L) != range0.contains(element16)) throw AssertionError() +} + +fun testR0xE17() { + // with possible local optimizations + if (1.toDouble() in 1L .. 3L != range0.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in 1L .. 3L != !range0.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in 1L .. 3L) != !range0.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in 1L .. 3L) != range0.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in 1L .. 3L != range0.contains(element17)) throw AssertionError() + if (element17 !in 1L .. 3L != !range0.contains(element17)) throw AssertionError() + if (!(element17 in 1L .. 3L) != !range0.contains(element17)) throw AssertionError() + if (!(element17 !in 1L .. 3L) != range0.contains(element17)) throw AssertionError() +} + +fun testR0xE18() { + // with possible local optimizations + if (2.toByte() in 1L .. 3L != range0.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 1L .. 3L != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 1L .. 3L) != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 1L .. 3L) != range0.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in 1L .. 3L != range0.contains(element18)) throw AssertionError() + if (element18 !in 1L .. 3L != !range0.contains(element18)) throw AssertionError() + if (!(element18 in 1L .. 3L) != !range0.contains(element18)) throw AssertionError() + if (!(element18 !in 1L .. 3L) != range0.contains(element18)) throw AssertionError() +} + +fun testR0xE19() { + // with possible local optimizations + if (2.toShort() in 1L .. 3L != range0.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 1L .. 3L != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 1L .. 3L) != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 1L .. 3L) != range0.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in 1L .. 3L != range0.contains(element19)) throw AssertionError() + if (element19 !in 1L .. 3L != !range0.contains(element19)) throw AssertionError() + if (!(element19 in 1L .. 3L) != !range0.contains(element19)) throw AssertionError() + if (!(element19 !in 1L .. 3L) != range0.contains(element19)) throw AssertionError() +} + +fun testR0xE20() { + // with possible local optimizations + if (2 in 1L .. 3L != range0.contains(2)) throw AssertionError() + if (2 !in 1L .. 3L != !range0.contains(2)) throw AssertionError() + if (!(2 in 1L .. 3L) != !range0.contains(2)) throw AssertionError() + if (!(2 !in 1L .. 3L) != range0.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in 1L .. 3L != range0.contains(element20)) throw AssertionError() + if (element20 !in 1L .. 3L != !range0.contains(element20)) throw AssertionError() + if (!(element20 in 1L .. 3L) != !range0.contains(element20)) throw AssertionError() + if (!(element20 !in 1L .. 3L) != range0.contains(element20)) throw AssertionError() +} + +fun testR0xE21() { + // with possible local optimizations + if (2.toLong() in 1L .. 3L != range0.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in 1L .. 3L != !range0.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in 1L .. 3L) != !range0.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in 1L .. 3L) != range0.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in 1L .. 3L != range0.contains(element21)) throw AssertionError() + if (element21 !in 1L .. 3L != !range0.contains(element21)) throw AssertionError() + if (!(element21 in 1L .. 3L) != !range0.contains(element21)) throw AssertionError() + if (!(element21 !in 1L .. 3L) != range0.contains(element21)) throw AssertionError() +} + +fun testR0xE22() { + // with possible local optimizations + if (2.toFloat() in 1L .. 3L != range0.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in 1L .. 3L != !range0.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in 1L .. 3L) != !range0.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in 1L .. 3L) != range0.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in 1L .. 3L != range0.contains(element22)) throw AssertionError() + if (element22 !in 1L .. 3L != !range0.contains(element22)) throw AssertionError() + if (!(element22 in 1L .. 3L) != !range0.contains(element22)) throw AssertionError() + if (!(element22 !in 1L .. 3L) != range0.contains(element22)) throw AssertionError() +} + +fun testR0xE23() { + // with possible local optimizations + if (2.toDouble() in 1L .. 3L != range0.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in 1L .. 3L != !range0.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in 1L .. 3L) != !range0.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in 1L .. 3L) != range0.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in 1L .. 3L != range0.contains(element23)) throw AssertionError() + if (element23 !in 1L .. 3L != !range0.contains(element23)) throw AssertionError() + if (!(element23 in 1L .. 3L) != !range0.contains(element23)) throw AssertionError() + if (!(element23 !in 1L .. 3L) != range0.contains(element23)) throw AssertionError() +} + +fun testR0xE24() { + // with possible local optimizations + if (3.toByte() in 1L .. 3L != range0.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 1L .. 3L != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 1L .. 3L) != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 1L .. 3L) != range0.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in 1L .. 3L != range0.contains(element24)) throw AssertionError() + if (element24 !in 1L .. 3L != !range0.contains(element24)) throw AssertionError() + if (!(element24 in 1L .. 3L) != !range0.contains(element24)) throw AssertionError() + if (!(element24 !in 1L .. 3L) != range0.contains(element24)) throw AssertionError() +} + +fun testR0xE25() { + // with possible local optimizations + if (3.toShort() in 1L .. 3L != range0.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 1L .. 3L != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 1L .. 3L) != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 1L .. 3L) != range0.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in 1L .. 3L != range0.contains(element25)) throw AssertionError() + if (element25 !in 1L .. 3L != !range0.contains(element25)) throw AssertionError() + if (!(element25 in 1L .. 3L) != !range0.contains(element25)) throw AssertionError() + if (!(element25 !in 1L .. 3L) != range0.contains(element25)) throw AssertionError() +} + +fun testR0xE26() { + // with possible local optimizations + if (3 in 1L .. 3L != range0.contains(3)) throw AssertionError() + if (3 !in 1L .. 3L != !range0.contains(3)) throw AssertionError() + if (!(3 in 1L .. 3L) != !range0.contains(3)) throw AssertionError() + if (!(3 !in 1L .. 3L) != range0.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in 1L .. 3L != range0.contains(element26)) throw AssertionError() + if (element26 !in 1L .. 3L != !range0.contains(element26)) throw AssertionError() + if (!(element26 in 1L .. 3L) != !range0.contains(element26)) throw AssertionError() + if (!(element26 !in 1L .. 3L) != range0.contains(element26)) throw AssertionError() +} + +fun testR0xE27() { + // with possible local optimizations + if (3.toLong() in 1L .. 3L != range0.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in 1L .. 3L != !range0.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in 1L .. 3L) != !range0.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in 1L .. 3L) != range0.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in 1L .. 3L != range0.contains(element27)) throw AssertionError() + if (element27 !in 1L .. 3L != !range0.contains(element27)) throw AssertionError() + if (!(element27 in 1L .. 3L) != !range0.contains(element27)) throw AssertionError() + if (!(element27 !in 1L .. 3L) != range0.contains(element27)) throw AssertionError() +} + +fun testR0xE28() { + // with possible local optimizations + if (3.toFloat() in 1L .. 3L != range0.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in 1L .. 3L != !range0.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in 1L .. 3L) != !range0.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in 1L .. 3L) != range0.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in 1L .. 3L != range0.contains(element28)) throw AssertionError() + if (element28 !in 1L .. 3L != !range0.contains(element28)) throw AssertionError() + if (!(element28 in 1L .. 3L) != !range0.contains(element28)) throw AssertionError() + if (!(element28 !in 1L .. 3L) != range0.contains(element28)) throw AssertionError() +} + +fun testR0xE29() { + // with possible local optimizations + if (3.toDouble() in 1L .. 3L != range0.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in 1L .. 3L != !range0.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in 1L .. 3L) != !range0.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in 1L .. 3L) != range0.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in 1L .. 3L != range0.contains(element29)) throw AssertionError() + if (element29 !in 1L .. 3L != !range0.contains(element29)) throw AssertionError() + if (!(element29 in 1L .. 3L) != !range0.contains(element29)) throw AssertionError() + if (!(element29 !in 1L .. 3L) != range0.contains(element29)) throw AssertionError() +} + +fun testR0xE30() { + // with possible local optimizations + if (4.toByte() in 1L .. 3L != range0.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 1L .. 3L != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 1L .. 3L) != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 1L .. 3L) != range0.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in 1L .. 3L != range0.contains(element30)) throw AssertionError() + if (element30 !in 1L .. 3L != !range0.contains(element30)) throw AssertionError() + if (!(element30 in 1L .. 3L) != !range0.contains(element30)) throw AssertionError() + if (!(element30 !in 1L .. 3L) != range0.contains(element30)) throw AssertionError() +} + +fun testR0xE31() { + // with possible local optimizations + if (4.toShort() in 1L .. 3L != range0.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 1L .. 3L != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 1L .. 3L) != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 1L .. 3L) != range0.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in 1L .. 3L != range0.contains(element31)) throw AssertionError() + if (element31 !in 1L .. 3L != !range0.contains(element31)) throw AssertionError() + if (!(element31 in 1L .. 3L) != !range0.contains(element31)) throw AssertionError() + if (!(element31 !in 1L .. 3L) != range0.contains(element31)) throw AssertionError() +} + +fun testR0xE32() { + // with possible local optimizations + if (4 in 1L .. 3L != range0.contains(4)) throw AssertionError() + if (4 !in 1L .. 3L != !range0.contains(4)) throw AssertionError() + if (!(4 in 1L .. 3L) != !range0.contains(4)) throw AssertionError() + if (!(4 !in 1L .. 3L) != range0.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in 1L .. 3L != range0.contains(element32)) throw AssertionError() + if (element32 !in 1L .. 3L != !range0.contains(element32)) throw AssertionError() + if (!(element32 in 1L .. 3L) != !range0.contains(element32)) throw AssertionError() + if (!(element32 !in 1L .. 3L) != range0.contains(element32)) throw AssertionError() +} + +fun testR0xE33() { + // with possible local optimizations + if (4.toLong() in 1L .. 3L != range0.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in 1L .. 3L != !range0.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in 1L .. 3L) != !range0.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in 1L .. 3L) != range0.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in 1L .. 3L != range0.contains(element33)) throw AssertionError() + if (element33 !in 1L .. 3L != !range0.contains(element33)) throw AssertionError() + if (!(element33 in 1L .. 3L) != !range0.contains(element33)) throw AssertionError() + if (!(element33 !in 1L .. 3L) != range0.contains(element33)) throw AssertionError() +} + +fun testR0xE34() { + // with possible local optimizations + if (4.toFloat() in 1L .. 3L != range0.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in 1L .. 3L != !range0.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in 1L .. 3L) != !range0.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in 1L .. 3L) != range0.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in 1L .. 3L != range0.contains(element34)) throw AssertionError() + if (element34 !in 1L .. 3L != !range0.contains(element34)) throw AssertionError() + if (!(element34 in 1L .. 3L) != !range0.contains(element34)) throw AssertionError() + if (!(element34 !in 1L .. 3L) != range0.contains(element34)) throw AssertionError() +} + +fun testR0xE35() { + // with possible local optimizations + if (4.toDouble() in 1L .. 3L != range0.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in 1L .. 3L != !range0.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in 1L .. 3L) != !range0.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in 1L .. 3L) != range0.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in 1L .. 3L != range0.contains(element35)) throw AssertionError() + if (element35 !in 1L .. 3L != !range0.contains(element35)) throw AssertionError() + if (!(element35 in 1L .. 3L) != !range0.contains(element35)) throw AssertionError() + if (!(element35 !in 1L .. 3L) != range0.contains(element35)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if ((-1).toByte() in 3L .. 1L != range1.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 3L .. 1L != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 3L .. 1L) != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 3L .. 1L) != range1.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 3L .. 1L != range1.contains(element0)) throw AssertionError() + if (element0 !in 3L .. 1L != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3L .. 1L) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3L .. 1L) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if ((-1).toShort() in 3L .. 1L != range1.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 3L .. 1L != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 3L .. 1L) != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 3L .. 1L) != range1.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 3L .. 1L != range1.contains(element1)) throw AssertionError() + if (element1 !in 3L .. 1L != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3L .. 1L) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3L .. 1L) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if ((-1) in 3L .. 1L != range1.contains((-1))) throw AssertionError() + if ((-1) !in 3L .. 1L != !range1.contains((-1))) throw AssertionError() + if (!((-1) in 3L .. 1L) != !range1.contains((-1))) throw AssertionError() + if (!((-1) !in 3L .. 1L) != range1.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in 3L .. 1L != range1.contains(element2)) throw AssertionError() + if (element2 !in 3L .. 1L != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3L .. 1L) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3L .. 1L) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if ((-1).toLong() in 3L .. 1L != range1.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in 3L .. 1L != !range1.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in 3L .. 1L) != !range1.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in 3L .. 1L) != range1.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in 3L .. 1L != range1.contains(element3)) throw AssertionError() + if (element3 !in 3L .. 1L != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3L .. 1L) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3L .. 1L) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if ((-1).toFloat() in 3L .. 1L != range1.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in 3L .. 1L != !range1.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in 3L .. 1L) != !range1.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in 3L .. 1L) != range1.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in 3L .. 1L != range1.contains(element4)) throw AssertionError() + if (element4 !in 3L .. 1L != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3L .. 1L) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3L .. 1L) != range1.contains(element4)) throw AssertionError() +} + +fun testR1xE5() { + // with possible local optimizations + if ((-1).toDouble() in 3L .. 1L != range1.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in 3L .. 1L != !range1.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in 3L .. 1L) != !range1.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in 3L .. 1L) != range1.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in 3L .. 1L != range1.contains(element5)) throw AssertionError() + if (element5 !in 3L .. 1L != !range1.contains(element5)) throw AssertionError() + if (!(element5 in 3L .. 1L) != !range1.contains(element5)) throw AssertionError() + if (!(element5 !in 3L .. 1L) != range1.contains(element5)) throw AssertionError() +} + +fun testR1xE6() { + // with possible local optimizations + if (0.toByte() in 3L .. 1L != range1.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 3L .. 1L != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 3L .. 1L) != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 3L .. 1L) != range1.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in 3L .. 1L != range1.contains(element6)) throw AssertionError() + if (element6 !in 3L .. 1L != !range1.contains(element6)) throw AssertionError() + if (!(element6 in 3L .. 1L) != !range1.contains(element6)) throw AssertionError() + if (!(element6 !in 3L .. 1L) != range1.contains(element6)) throw AssertionError() +} + +fun testR1xE7() { + // with possible local optimizations + if (0.toShort() in 3L .. 1L != range1.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 3L .. 1L != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 3L .. 1L) != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 3L .. 1L) != range1.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in 3L .. 1L != range1.contains(element7)) throw AssertionError() + if (element7 !in 3L .. 1L != !range1.contains(element7)) throw AssertionError() + if (!(element7 in 3L .. 1L) != !range1.contains(element7)) throw AssertionError() + if (!(element7 !in 3L .. 1L) != range1.contains(element7)) throw AssertionError() +} + +fun testR1xE8() { + // with possible local optimizations + if (0 in 3L .. 1L != range1.contains(0)) throw AssertionError() + if (0 !in 3L .. 1L != !range1.contains(0)) throw AssertionError() + if (!(0 in 3L .. 1L) != !range1.contains(0)) throw AssertionError() + if (!(0 !in 3L .. 1L) != range1.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in 3L .. 1L != range1.contains(element8)) throw AssertionError() + if (element8 !in 3L .. 1L != !range1.contains(element8)) throw AssertionError() + if (!(element8 in 3L .. 1L) != !range1.contains(element8)) throw AssertionError() + if (!(element8 !in 3L .. 1L) != range1.contains(element8)) throw AssertionError() +} + +fun testR1xE9() { + // with possible local optimizations + if (0.toLong() in 3L .. 1L != range1.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in 3L .. 1L != !range1.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in 3L .. 1L) != !range1.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in 3L .. 1L) != range1.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in 3L .. 1L != range1.contains(element9)) throw AssertionError() + if (element9 !in 3L .. 1L != !range1.contains(element9)) throw AssertionError() + if (!(element9 in 3L .. 1L) != !range1.contains(element9)) throw AssertionError() + if (!(element9 !in 3L .. 1L) != range1.contains(element9)) throw AssertionError() +} + +fun testR1xE10() { + // with possible local optimizations + if (0.toFloat() in 3L .. 1L != range1.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in 3L .. 1L != !range1.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in 3L .. 1L) != !range1.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in 3L .. 1L) != range1.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in 3L .. 1L != range1.contains(element10)) throw AssertionError() + if (element10 !in 3L .. 1L != !range1.contains(element10)) throw AssertionError() + if (!(element10 in 3L .. 1L) != !range1.contains(element10)) throw AssertionError() + if (!(element10 !in 3L .. 1L) != range1.contains(element10)) throw AssertionError() +} + +fun testR1xE11() { + // with possible local optimizations + if (0.toDouble() in 3L .. 1L != range1.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in 3L .. 1L != !range1.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in 3L .. 1L) != !range1.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in 3L .. 1L) != range1.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in 3L .. 1L != range1.contains(element11)) throw AssertionError() + if (element11 !in 3L .. 1L != !range1.contains(element11)) throw AssertionError() + if (!(element11 in 3L .. 1L) != !range1.contains(element11)) throw AssertionError() + if (!(element11 !in 3L .. 1L) != range1.contains(element11)) throw AssertionError() +} + +fun testR1xE12() { + // with possible local optimizations + if (1.toByte() in 3L .. 1L != range1.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 3L .. 1L != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 3L .. 1L) != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 3L .. 1L) != range1.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 3L .. 1L != range1.contains(element12)) throw AssertionError() + if (element12 !in 3L .. 1L != !range1.contains(element12)) throw AssertionError() + if (!(element12 in 3L .. 1L) != !range1.contains(element12)) throw AssertionError() + if (!(element12 !in 3L .. 1L) != range1.contains(element12)) throw AssertionError() +} + +fun testR1xE13() { + // with possible local optimizations + if (1.toShort() in 3L .. 1L != range1.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 3L .. 1L != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 3L .. 1L) != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 3L .. 1L) != range1.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 3L .. 1L != range1.contains(element13)) throw AssertionError() + if (element13 !in 3L .. 1L != !range1.contains(element13)) throw AssertionError() + if (!(element13 in 3L .. 1L) != !range1.contains(element13)) throw AssertionError() + if (!(element13 !in 3L .. 1L) != range1.contains(element13)) throw AssertionError() +} + +fun testR1xE14() { + // with possible local optimizations + if (1 in 3L .. 1L != range1.contains(1)) throw AssertionError() + if (1 !in 3L .. 1L != !range1.contains(1)) throw AssertionError() + if (!(1 in 3L .. 1L) != !range1.contains(1)) throw AssertionError() + if (!(1 !in 3L .. 1L) != range1.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in 3L .. 1L != range1.contains(element14)) throw AssertionError() + if (element14 !in 3L .. 1L != !range1.contains(element14)) throw AssertionError() + if (!(element14 in 3L .. 1L) != !range1.contains(element14)) throw AssertionError() + if (!(element14 !in 3L .. 1L) != range1.contains(element14)) throw AssertionError() +} + +fun testR1xE15() { + // with possible local optimizations + if (1.toLong() in 3L .. 1L != range1.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in 3L .. 1L != !range1.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in 3L .. 1L) != !range1.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in 3L .. 1L) != range1.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in 3L .. 1L != range1.contains(element15)) throw AssertionError() + if (element15 !in 3L .. 1L != !range1.contains(element15)) throw AssertionError() + if (!(element15 in 3L .. 1L) != !range1.contains(element15)) throw AssertionError() + if (!(element15 !in 3L .. 1L) != range1.contains(element15)) throw AssertionError() +} + +fun testR1xE16() { + // with possible local optimizations + if (1.toFloat() in 3L .. 1L != range1.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in 3L .. 1L != !range1.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in 3L .. 1L) != !range1.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in 3L .. 1L) != range1.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in 3L .. 1L != range1.contains(element16)) throw AssertionError() + if (element16 !in 3L .. 1L != !range1.contains(element16)) throw AssertionError() + if (!(element16 in 3L .. 1L) != !range1.contains(element16)) throw AssertionError() + if (!(element16 !in 3L .. 1L) != range1.contains(element16)) throw AssertionError() +} + +fun testR1xE17() { + // with possible local optimizations + if (1.toDouble() in 3L .. 1L != range1.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in 3L .. 1L != !range1.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in 3L .. 1L) != !range1.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in 3L .. 1L) != range1.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in 3L .. 1L != range1.contains(element17)) throw AssertionError() + if (element17 !in 3L .. 1L != !range1.contains(element17)) throw AssertionError() + if (!(element17 in 3L .. 1L) != !range1.contains(element17)) throw AssertionError() + if (!(element17 !in 3L .. 1L) != range1.contains(element17)) throw AssertionError() +} + +fun testR1xE18() { + // with possible local optimizations + if (2.toByte() in 3L .. 1L != range1.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 3L .. 1L != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 3L .. 1L) != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 3L .. 1L) != range1.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in 3L .. 1L != range1.contains(element18)) throw AssertionError() + if (element18 !in 3L .. 1L != !range1.contains(element18)) throw AssertionError() + if (!(element18 in 3L .. 1L) != !range1.contains(element18)) throw AssertionError() + if (!(element18 !in 3L .. 1L) != range1.contains(element18)) throw AssertionError() +} + +fun testR1xE19() { + // with possible local optimizations + if (2.toShort() in 3L .. 1L != range1.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 3L .. 1L != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 3L .. 1L) != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 3L .. 1L) != range1.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in 3L .. 1L != range1.contains(element19)) throw AssertionError() + if (element19 !in 3L .. 1L != !range1.contains(element19)) throw AssertionError() + if (!(element19 in 3L .. 1L) != !range1.contains(element19)) throw AssertionError() + if (!(element19 !in 3L .. 1L) != range1.contains(element19)) throw AssertionError() +} + +fun testR1xE20() { + // with possible local optimizations + if (2 in 3L .. 1L != range1.contains(2)) throw AssertionError() + if (2 !in 3L .. 1L != !range1.contains(2)) throw AssertionError() + if (!(2 in 3L .. 1L) != !range1.contains(2)) throw AssertionError() + if (!(2 !in 3L .. 1L) != range1.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in 3L .. 1L != range1.contains(element20)) throw AssertionError() + if (element20 !in 3L .. 1L != !range1.contains(element20)) throw AssertionError() + if (!(element20 in 3L .. 1L) != !range1.contains(element20)) throw AssertionError() + if (!(element20 !in 3L .. 1L) != range1.contains(element20)) throw AssertionError() +} + +fun testR1xE21() { + // with possible local optimizations + if (2.toLong() in 3L .. 1L != range1.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in 3L .. 1L != !range1.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in 3L .. 1L) != !range1.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in 3L .. 1L) != range1.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in 3L .. 1L != range1.contains(element21)) throw AssertionError() + if (element21 !in 3L .. 1L != !range1.contains(element21)) throw AssertionError() + if (!(element21 in 3L .. 1L) != !range1.contains(element21)) throw AssertionError() + if (!(element21 !in 3L .. 1L) != range1.contains(element21)) throw AssertionError() +} + +fun testR1xE22() { + // with possible local optimizations + if (2.toFloat() in 3L .. 1L != range1.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in 3L .. 1L != !range1.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in 3L .. 1L) != !range1.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in 3L .. 1L) != range1.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in 3L .. 1L != range1.contains(element22)) throw AssertionError() + if (element22 !in 3L .. 1L != !range1.contains(element22)) throw AssertionError() + if (!(element22 in 3L .. 1L) != !range1.contains(element22)) throw AssertionError() + if (!(element22 !in 3L .. 1L) != range1.contains(element22)) throw AssertionError() +} + +fun testR1xE23() { + // with possible local optimizations + if (2.toDouble() in 3L .. 1L != range1.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in 3L .. 1L != !range1.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in 3L .. 1L) != !range1.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in 3L .. 1L) != range1.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in 3L .. 1L != range1.contains(element23)) throw AssertionError() + if (element23 !in 3L .. 1L != !range1.contains(element23)) throw AssertionError() + if (!(element23 in 3L .. 1L) != !range1.contains(element23)) throw AssertionError() + if (!(element23 !in 3L .. 1L) != range1.contains(element23)) throw AssertionError() +} + +fun testR1xE24() { + // with possible local optimizations + if (3.toByte() in 3L .. 1L != range1.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 3L .. 1L != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 3L .. 1L) != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 3L .. 1L) != range1.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in 3L .. 1L != range1.contains(element24)) throw AssertionError() + if (element24 !in 3L .. 1L != !range1.contains(element24)) throw AssertionError() + if (!(element24 in 3L .. 1L) != !range1.contains(element24)) throw AssertionError() + if (!(element24 !in 3L .. 1L) != range1.contains(element24)) throw AssertionError() +} + +fun testR1xE25() { + // with possible local optimizations + if (3.toShort() in 3L .. 1L != range1.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 3L .. 1L != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 3L .. 1L) != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 3L .. 1L) != range1.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in 3L .. 1L != range1.contains(element25)) throw AssertionError() + if (element25 !in 3L .. 1L != !range1.contains(element25)) throw AssertionError() + if (!(element25 in 3L .. 1L) != !range1.contains(element25)) throw AssertionError() + if (!(element25 !in 3L .. 1L) != range1.contains(element25)) throw AssertionError() +} + +fun testR1xE26() { + // with possible local optimizations + if (3 in 3L .. 1L != range1.contains(3)) throw AssertionError() + if (3 !in 3L .. 1L != !range1.contains(3)) throw AssertionError() + if (!(3 in 3L .. 1L) != !range1.contains(3)) throw AssertionError() + if (!(3 !in 3L .. 1L) != range1.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in 3L .. 1L != range1.contains(element26)) throw AssertionError() + if (element26 !in 3L .. 1L != !range1.contains(element26)) throw AssertionError() + if (!(element26 in 3L .. 1L) != !range1.contains(element26)) throw AssertionError() + if (!(element26 !in 3L .. 1L) != range1.contains(element26)) throw AssertionError() +} + +fun testR1xE27() { + // with possible local optimizations + if (3.toLong() in 3L .. 1L != range1.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in 3L .. 1L != !range1.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in 3L .. 1L) != !range1.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in 3L .. 1L) != range1.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in 3L .. 1L != range1.contains(element27)) throw AssertionError() + if (element27 !in 3L .. 1L != !range1.contains(element27)) throw AssertionError() + if (!(element27 in 3L .. 1L) != !range1.contains(element27)) throw AssertionError() + if (!(element27 !in 3L .. 1L) != range1.contains(element27)) throw AssertionError() +} + +fun testR1xE28() { + // with possible local optimizations + if (3.toFloat() in 3L .. 1L != range1.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in 3L .. 1L != !range1.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in 3L .. 1L) != !range1.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in 3L .. 1L) != range1.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in 3L .. 1L != range1.contains(element28)) throw AssertionError() + if (element28 !in 3L .. 1L != !range1.contains(element28)) throw AssertionError() + if (!(element28 in 3L .. 1L) != !range1.contains(element28)) throw AssertionError() + if (!(element28 !in 3L .. 1L) != range1.contains(element28)) throw AssertionError() +} + +fun testR1xE29() { + // with possible local optimizations + if (3.toDouble() in 3L .. 1L != range1.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in 3L .. 1L != !range1.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in 3L .. 1L) != !range1.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in 3L .. 1L) != range1.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in 3L .. 1L != range1.contains(element29)) throw AssertionError() + if (element29 !in 3L .. 1L != !range1.contains(element29)) throw AssertionError() + if (!(element29 in 3L .. 1L) != !range1.contains(element29)) throw AssertionError() + if (!(element29 !in 3L .. 1L) != range1.contains(element29)) throw AssertionError() +} + +fun testR1xE30() { + // with possible local optimizations + if (4.toByte() in 3L .. 1L != range1.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 3L .. 1L != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 3L .. 1L) != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 3L .. 1L) != range1.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in 3L .. 1L != range1.contains(element30)) throw AssertionError() + if (element30 !in 3L .. 1L != !range1.contains(element30)) throw AssertionError() + if (!(element30 in 3L .. 1L) != !range1.contains(element30)) throw AssertionError() + if (!(element30 !in 3L .. 1L) != range1.contains(element30)) throw AssertionError() +} + +fun testR1xE31() { + // with possible local optimizations + if (4.toShort() in 3L .. 1L != range1.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 3L .. 1L != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 3L .. 1L) != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 3L .. 1L) != range1.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in 3L .. 1L != range1.contains(element31)) throw AssertionError() + if (element31 !in 3L .. 1L != !range1.contains(element31)) throw AssertionError() + if (!(element31 in 3L .. 1L) != !range1.contains(element31)) throw AssertionError() + if (!(element31 !in 3L .. 1L) != range1.contains(element31)) throw AssertionError() +} + +fun testR1xE32() { + // with possible local optimizations + if (4 in 3L .. 1L != range1.contains(4)) throw AssertionError() + if (4 !in 3L .. 1L != !range1.contains(4)) throw AssertionError() + if (!(4 in 3L .. 1L) != !range1.contains(4)) throw AssertionError() + if (!(4 !in 3L .. 1L) != range1.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in 3L .. 1L != range1.contains(element32)) throw AssertionError() + if (element32 !in 3L .. 1L != !range1.contains(element32)) throw AssertionError() + if (!(element32 in 3L .. 1L) != !range1.contains(element32)) throw AssertionError() + if (!(element32 !in 3L .. 1L) != range1.contains(element32)) throw AssertionError() +} + +fun testR1xE33() { + // with possible local optimizations + if (4.toLong() in 3L .. 1L != range1.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in 3L .. 1L != !range1.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in 3L .. 1L) != !range1.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in 3L .. 1L) != range1.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in 3L .. 1L != range1.contains(element33)) throw AssertionError() + if (element33 !in 3L .. 1L != !range1.contains(element33)) throw AssertionError() + if (!(element33 in 3L .. 1L) != !range1.contains(element33)) throw AssertionError() + if (!(element33 !in 3L .. 1L) != range1.contains(element33)) throw AssertionError() +} + +fun testR1xE34() { + // with possible local optimizations + if (4.toFloat() in 3L .. 1L != range1.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in 3L .. 1L != !range1.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in 3L .. 1L) != !range1.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in 3L .. 1L) != range1.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in 3L .. 1L != range1.contains(element34)) throw AssertionError() + if (element34 !in 3L .. 1L != !range1.contains(element34)) throw AssertionError() + if (!(element34 in 3L .. 1L) != !range1.contains(element34)) throw AssertionError() + if (!(element34 !in 3L .. 1L) != range1.contains(element34)) throw AssertionError() +} + +fun testR1xE35() { + // with possible local optimizations + if (4.toDouble() in 3L .. 1L != range1.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in 3L .. 1L != !range1.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in 3L .. 1L) != !range1.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in 3L .. 1L) != range1.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in 3L .. 1L != range1.contains(element35)) throw AssertionError() + if (element35 !in 3L .. 1L != !range1.contains(element35)) throw AssertionError() + if (!(element35 in 3L .. 1L) != !range1.contains(element35)) throw AssertionError() + if (!(element35 !in 3L .. 1L) != range1.contains(element35)) throw AssertionError() +} + + diff --git a/backend.native/tests/external/codegen/box/ranges/contains/generated/longUntil.kt b/backend.native/tests/external/codegen/box/ranges/contains/generated/longUntil.kt new file mode 100644 index 00000000000..15efde78c8f --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/generated/longUntil.kt @@ -0,0 +1,1058 @@ +// Auto-generated by GenerateInRangeExpressionTestData. Do not edit! +// WITH_RUNTIME + + + +val range0 = 1L until 3L +val range1 = 3L until 1L + +val element0 = (-1).toByte() +val element1 = (-1).toShort() +val element2 = (-1) +val element3 = (-1).toLong() +val element4 = (-1).toFloat() +val element5 = (-1).toDouble() +val element6 = 0.toByte() +val element7 = 0.toShort() +val element8 = 0 +val element9 = 0.toLong() +val element10 = 0.toFloat() +val element11 = 0.toDouble() +val element12 = 1.toByte() +val element13 = 1.toShort() +val element14 = 1 +val element15 = 1.toLong() +val element16 = 1.toFloat() +val element17 = 1.toDouble() +val element18 = 2.toByte() +val element19 = 2.toShort() +val element20 = 2 +val element21 = 2.toLong() +val element22 = 2.toFloat() +val element23 = 2.toDouble() +val element24 = 3.toByte() +val element25 = 3.toShort() +val element26 = 3 +val element27 = 3.toLong() +val element28 = 3.toFloat() +val element29 = 3.toDouble() +val element30 = 4.toByte() +val element31 = 4.toShort() +val element32 = 4 +val element33 = 4.toLong() +val element34 = 4.toFloat() +val element35 = 4.toDouble() + +fun box(): String { + testR0xE0() + testR0xE1() + testR0xE2() + testR0xE3() + testR0xE4() + testR0xE5() + testR0xE6() + testR0xE7() + testR0xE8() + testR0xE9() + testR0xE10() + testR0xE11() + testR0xE12() + testR0xE13() + testR0xE14() + testR0xE15() + testR0xE16() + testR0xE17() + testR0xE18() + testR0xE19() + testR0xE20() + testR0xE21() + testR0xE22() + testR0xE23() + testR0xE24() + testR0xE25() + testR0xE26() + testR0xE27() + testR0xE28() + testR0xE29() + testR0xE30() + testR0xE31() + testR0xE32() + testR0xE33() + testR0xE34() + testR0xE35() + testR1xE0() + testR1xE1() + testR1xE2() + testR1xE3() + testR1xE4() + testR1xE5() + testR1xE6() + testR1xE7() + testR1xE8() + testR1xE9() + testR1xE10() + testR1xE11() + testR1xE12() + testR1xE13() + testR1xE14() + testR1xE15() + testR1xE16() + testR1xE17() + testR1xE18() + testR1xE19() + testR1xE20() + testR1xE21() + testR1xE22() + testR1xE23() + testR1xE24() + testR1xE25() + testR1xE26() + testR1xE27() + testR1xE28() + testR1xE29() + testR1xE30() + testR1xE31() + testR1xE32() + testR1xE33() + testR1xE34() + testR1xE35() + return "OK" +} + +fun testR0xE0() { + // with possible local optimizations + if ((-1).toByte() in 1L until 3L != range0.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 1L until 3L != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 1L until 3L) != !range0.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 1L until 3L) != range0.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 1L until 3L != range0.contains(element0)) throw AssertionError() + if (element0 !in 1L until 3L != !range0.contains(element0)) throw AssertionError() + if (!(element0 in 1L until 3L) != !range0.contains(element0)) throw AssertionError() + if (!(element0 !in 1L until 3L) != range0.contains(element0)) throw AssertionError() +} + +fun testR0xE1() { + // with possible local optimizations + if ((-1).toShort() in 1L until 3L != range0.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 1L until 3L != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 1L until 3L) != !range0.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 1L until 3L) != range0.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 1L until 3L != range0.contains(element1)) throw AssertionError() + if (element1 !in 1L until 3L != !range0.contains(element1)) throw AssertionError() + if (!(element1 in 1L until 3L) != !range0.contains(element1)) throw AssertionError() + if (!(element1 !in 1L until 3L) != range0.contains(element1)) throw AssertionError() +} + +fun testR0xE2() { + // with possible local optimizations + if ((-1) in 1L until 3L != range0.contains((-1))) throw AssertionError() + if ((-1) !in 1L until 3L != !range0.contains((-1))) throw AssertionError() + if (!((-1) in 1L until 3L) != !range0.contains((-1))) throw AssertionError() + if (!((-1) !in 1L until 3L) != range0.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in 1L until 3L != range0.contains(element2)) throw AssertionError() + if (element2 !in 1L until 3L != !range0.contains(element2)) throw AssertionError() + if (!(element2 in 1L until 3L) != !range0.contains(element2)) throw AssertionError() + if (!(element2 !in 1L until 3L) != range0.contains(element2)) throw AssertionError() +} + +fun testR0xE3() { + // with possible local optimizations + if ((-1).toLong() in 1L until 3L != range0.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in 1L until 3L != !range0.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in 1L until 3L) != !range0.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in 1L until 3L) != range0.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in 1L until 3L != range0.contains(element3)) throw AssertionError() + if (element3 !in 1L until 3L != !range0.contains(element3)) throw AssertionError() + if (!(element3 in 1L until 3L) != !range0.contains(element3)) throw AssertionError() + if (!(element3 !in 1L until 3L) != range0.contains(element3)) throw AssertionError() +} + +fun testR0xE4() { + // with possible local optimizations + if ((-1).toFloat() in 1L until 3L != range0.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in 1L until 3L != !range0.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in 1L until 3L) != !range0.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in 1L until 3L) != range0.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in 1L until 3L != range0.contains(element4)) throw AssertionError() + if (element4 !in 1L until 3L != !range0.contains(element4)) throw AssertionError() + if (!(element4 in 1L until 3L) != !range0.contains(element4)) throw AssertionError() + if (!(element4 !in 1L until 3L) != range0.contains(element4)) throw AssertionError() +} + +fun testR0xE5() { + // with possible local optimizations + if ((-1).toDouble() in 1L until 3L != range0.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in 1L until 3L != !range0.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in 1L until 3L) != !range0.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in 1L until 3L) != range0.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in 1L until 3L != range0.contains(element5)) throw AssertionError() + if (element5 !in 1L until 3L != !range0.contains(element5)) throw AssertionError() + if (!(element5 in 1L until 3L) != !range0.contains(element5)) throw AssertionError() + if (!(element5 !in 1L until 3L) != range0.contains(element5)) throw AssertionError() +} + +fun testR0xE6() { + // with possible local optimizations + if (0.toByte() in 1L until 3L != range0.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 1L until 3L != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 1L until 3L) != !range0.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 1L until 3L) != range0.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in 1L until 3L != range0.contains(element6)) throw AssertionError() + if (element6 !in 1L until 3L != !range0.contains(element6)) throw AssertionError() + if (!(element6 in 1L until 3L) != !range0.contains(element6)) throw AssertionError() + if (!(element6 !in 1L until 3L) != range0.contains(element6)) throw AssertionError() +} + +fun testR0xE7() { + // with possible local optimizations + if (0.toShort() in 1L until 3L != range0.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 1L until 3L != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 1L until 3L) != !range0.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 1L until 3L) != range0.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in 1L until 3L != range0.contains(element7)) throw AssertionError() + if (element7 !in 1L until 3L != !range0.contains(element7)) throw AssertionError() + if (!(element7 in 1L until 3L) != !range0.contains(element7)) throw AssertionError() + if (!(element7 !in 1L until 3L) != range0.contains(element7)) throw AssertionError() +} + +fun testR0xE8() { + // with possible local optimizations + if (0 in 1L until 3L != range0.contains(0)) throw AssertionError() + if (0 !in 1L until 3L != !range0.contains(0)) throw AssertionError() + if (!(0 in 1L until 3L) != !range0.contains(0)) throw AssertionError() + if (!(0 !in 1L until 3L) != range0.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in 1L until 3L != range0.contains(element8)) throw AssertionError() + if (element8 !in 1L until 3L != !range0.contains(element8)) throw AssertionError() + if (!(element8 in 1L until 3L) != !range0.contains(element8)) throw AssertionError() + if (!(element8 !in 1L until 3L) != range0.contains(element8)) throw AssertionError() +} + +fun testR0xE9() { + // with possible local optimizations + if (0.toLong() in 1L until 3L != range0.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in 1L until 3L != !range0.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in 1L until 3L) != !range0.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in 1L until 3L) != range0.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in 1L until 3L != range0.contains(element9)) throw AssertionError() + if (element9 !in 1L until 3L != !range0.contains(element9)) throw AssertionError() + if (!(element9 in 1L until 3L) != !range0.contains(element9)) throw AssertionError() + if (!(element9 !in 1L until 3L) != range0.contains(element9)) throw AssertionError() +} + +fun testR0xE10() { + // with possible local optimizations + if (0.toFloat() in 1L until 3L != range0.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in 1L until 3L != !range0.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in 1L until 3L) != !range0.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in 1L until 3L) != range0.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in 1L until 3L != range0.contains(element10)) throw AssertionError() + if (element10 !in 1L until 3L != !range0.contains(element10)) throw AssertionError() + if (!(element10 in 1L until 3L) != !range0.contains(element10)) throw AssertionError() + if (!(element10 !in 1L until 3L) != range0.contains(element10)) throw AssertionError() +} + +fun testR0xE11() { + // with possible local optimizations + if (0.toDouble() in 1L until 3L != range0.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in 1L until 3L != !range0.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in 1L until 3L) != !range0.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in 1L until 3L) != range0.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in 1L until 3L != range0.contains(element11)) throw AssertionError() + if (element11 !in 1L until 3L != !range0.contains(element11)) throw AssertionError() + if (!(element11 in 1L until 3L) != !range0.contains(element11)) throw AssertionError() + if (!(element11 !in 1L until 3L) != range0.contains(element11)) throw AssertionError() +} + +fun testR0xE12() { + // with possible local optimizations + if (1.toByte() in 1L until 3L != range0.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 1L until 3L != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 1L until 3L) != !range0.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 1L until 3L) != range0.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 1L until 3L != range0.contains(element12)) throw AssertionError() + if (element12 !in 1L until 3L != !range0.contains(element12)) throw AssertionError() + if (!(element12 in 1L until 3L) != !range0.contains(element12)) throw AssertionError() + if (!(element12 !in 1L until 3L) != range0.contains(element12)) throw AssertionError() +} + +fun testR0xE13() { + // with possible local optimizations + if (1.toShort() in 1L until 3L != range0.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 1L until 3L != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 1L until 3L) != !range0.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 1L until 3L) != range0.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 1L until 3L != range0.contains(element13)) throw AssertionError() + if (element13 !in 1L until 3L != !range0.contains(element13)) throw AssertionError() + if (!(element13 in 1L until 3L) != !range0.contains(element13)) throw AssertionError() + if (!(element13 !in 1L until 3L) != range0.contains(element13)) throw AssertionError() +} + +fun testR0xE14() { + // with possible local optimizations + if (1 in 1L until 3L != range0.contains(1)) throw AssertionError() + if (1 !in 1L until 3L != !range0.contains(1)) throw AssertionError() + if (!(1 in 1L until 3L) != !range0.contains(1)) throw AssertionError() + if (!(1 !in 1L until 3L) != range0.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in 1L until 3L != range0.contains(element14)) throw AssertionError() + if (element14 !in 1L until 3L != !range0.contains(element14)) throw AssertionError() + if (!(element14 in 1L until 3L) != !range0.contains(element14)) throw AssertionError() + if (!(element14 !in 1L until 3L) != range0.contains(element14)) throw AssertionError() +} + +fun testR0xE15() { + // with possible local optimizations + if (1.toLong() in 1L until 3L != range0.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in 1L until 3L != !range0.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in 1L until 3L) != !range0.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in 1L until 3L) != range0.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in 1L until 3L != range0.contains(element15)) throw AssertionError() + if (element15 !in 1L until 3L != !range0.contains(element15)) throw AssertionError() + if (!(element15 in 1L until 3L) != !range0.contains(element15)) throw AssertionError() + if (!(element15 !in 1L until 3L) != range0.contains(element15)) throw AssertionError() +} + +fun testR0xE16() { + // with possible local optimizations + if (1.toFloat() in 1L until 3L != range0.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in 1L until 3L != !range0.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in 1L until 3L) != !range0.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in 1L until 3L) != range0.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in 1L until 3L != range0.contains(element16)) throw AssertionError() + if (element16 !in 1L until 3L != !range0.contains(element16)) throw AssertionError() + if (!(element16 in 1L until 3L) != !range0.contains(element16)) throw AssertionError() + if (!(element16 !in 1L until 3L) != range0.contains(element16)) throw AssertionError() +} + +fun testR0xE17() { + // with possible local optimizations + if (1.toDouble() in 1L until 3L != range0.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in 1L until 3L != !range0.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in 1L until 3L) != !range0.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in 1L until 3L) != range0.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in 1L until 3L != range0.contains(element17)) throw AssertionError() + if (element17 !in 1L until 3L != !range0.contains(element17)) throw AssertionError() + if (!(element17 in 1L until 3L) != !range0.contains(element17)) throw AssertionError() + if (!(element17 !in 1L until 3L) != range0.contains(element17)) throw AssertionError() +} + +fun testR0xE18() { + // with possible local optimizations + if (2.toByte() in 1L until 3L != range0.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 1L until 3L != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 1L until 3L) != !range0.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 1L until 3L) != range0.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in 1L until 3L != range0.contains(element18)) throw AssertionError() + if (element18 !in 1L until 3L != !range0.contains(element18)) throw AssertionError() + if (!(element18 in 1L until 3L) != !range0.contains(element18)) throw AssertionError() + if (!(element18 !in 1L until 3L) != range0.contains(element18)) throw AssertionError() +} + +fun testR0xE19() { + // with possible local optimizations + if (2.toShort() in 1L until 3L != range0.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 1L until 3L != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 1L until 3L) != !range0.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 1L until 3L) != range0.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in 1L until 3L != range0.contains(element19)) throw AssertionError() + if (element19 !in 1L until 3L != !range0.contains(element19)) throw AssertionError() + if (!(element19 in 1L until 3L) != !range0.contains(element19)) throw AssertionError() + if (!(element19 !in 1L until 3L) != range0.contains(element19)) throw AssertionError() +} + +fun testR0xE20() { + // with possible local optimizations + if (2 in 1L until 3L != range0.contains(2)) throw AssertionError() + if (2 !in 1L until 3L != !range0.contains(2)) throw AssertionError() + if (!(2 in 1L until 3L) != !range0.contains(2)) throw AssertionError() + if (!(2 !in 1L until 3L) != range0.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in 1L until 3L != range0.contains(element20)) throw AssertionError() + if (element20 !in 1L until 3L != !range0.contains(element20)) throw AssertionError() + if (!(element20 in 1L until 3L) != !range0.contains(element20)) throw AssertionError() + if (!(element20 !in 1L until 3L) != range0.contains(element20)) throw AssertionError() +} + +fun testR0xE21() { + // with possible local optimizations + if (2.toLong() in 1L until 3L != range0.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in 1L until 3L != !range0.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in 1L until 3L) != !range0.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in 1L until 3L) != range0.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in 1L until 3L != range0.contains(element21)) throw AssertionError() + if (element21 !in 1L until 3L != !range0.contains(element21)) throw AssertionError() + if (!(element21 in 1L until 3L) != !range0.contains(element21)) throw AssertionError() + if (!(element21 !in 1L until 3L) != range0.contains(element21)) throw AssertionError() +} + +fun testR0xE22() { + // with possible local optimizations + if (2.toFloat() in 1L until 3L != range0.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in 1L until 3L != !range0.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in 1L until 3L) != !range0.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in 1L until 3L) != range0.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in 1L until 3L != range0.contains(element22)) throw AssertionError() + if (element22 !in 1L until 3L != !range0.contains(element22)) throw AssertionError() + if (!(element22 in 1L until 3L) != !range0.contains(element22)) throw AssertionError() + if (!(element22 !in 1L until 3L) != range0.contains(element22)) throw AssertionError() +} + +fun testR0xE23() { + // with possible local optimizations + if (2.toDouble() in 1L until 3L != range0.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in 1L until 3L != !range0.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in 1L until 3L) != !range0.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in 1L until 3L) != range0.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in 1L until 3L != range0.contains(element23)) throw AssertionError() + if (element23 !in 1L until 3L != !range0.contains(element23)) throw AssertionError() + if (!(element23 in 1L until 3L) != !range0.contains(element23)) throw AssertionError() + if (!(element23 !in 1L until 3L) != range0.contains(element23)) throw AssertionError() +} + +fun testR0xE24() { + // with possible local optimizations + if (3.toByte() in 1L until 3L != range0.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 1L until 3L != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 1L until 3L) != !range0.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 1L until 3L) != range0.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in 1L until 3L != range0.contains(element24)) throw AssertionError() + if (element24 !in 1L until 3L != !range0.contains(element24)) throw AssertionError() + if (!(element24 in 1L until 3L) != !range0.contains(element24)) throw AssertionError() + if (!(element24 !in 1L until 3L) != range0.contains(element24)) throw AssertionError() +} + +fun testR0xE25() { + // with possible local optimizations + if (3.toShort() in 1L until 3L != range0.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 1L until 3L != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 1L until 3L) != !range0.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 1L until 3L) != range0.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in 1L until 3L != range0.contains(element25)) throw AssertionError() + if (element25 !in 1L until 3L != !range0.contains(element25)) throw AssertionError() + if (!(element25 in 1L until 3L) != !range0.contains(element25)) throw AssertionError() + if (!(element25 !in 1L until 3L) != range0.contains(element25)) throw AssertionError() +} + +fun testR0xE26() { + // with possible local optimizations + if (3 in 1L until 3L != range0.contains(3)) throw AssertionError() + if (3 !in 1L until 3L != !range0.contains(3)) throw AssertionError() + if (!(3 in 1L until 3L) != !range0.contains(3)) throw AssertionError() + if (!(3 !in 1L until 3L) != range0.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in 1L until 3L != range0.contains(element26)) throw AssertionError() + if (element26 !in 1L until 3L != !range0.contains(element26)) throw AssertionError() + if (!(element26 in 1L until 3L) != !range0.contains(element26)) throw AssertionError() + if (!(element26 !in 1L until 3L) != range0.contains(element26)) throw AssertionError() +} + +fun testR0xE27() { + // with possible local optimizations + if (3.toLong() in 1L until 3L != range0.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in 1L until 3L != !range0.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in 1L until 3L) != !range0.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in 1L until 3L) != range0.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in 1L until 3L != range0.contains(element27)) throw AssertionError() + if (element27 !in 1L until 3L != !range0.contains(element27)) throw AssertionError() + if (!(element27 in 1L until 3L) != !range0.contains(element27)) throw AssertionError() + if (!(element27 !in 1L until 3L) != range0.contains(element27)) throw AssertionError() +} + +fun testR0xE28() { + // with possible local optimizations + if (3.toFloat() in 1L until 3L != range0.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in 1L until 3L != !range0.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in 1L until 3L) != !range0.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in 1L until 3L) != range0.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in 1L until 3L != range0.contains(element28)) throw AssertionError() + if (element28 !in 1L until 3L != !range0.contains(element28)) throw AssertionError() + if (!(element28 in 1L until 3L) != !range0.contains(element28)) throw AssertionError() + if (!(element28 !in 1L until 3L) != range0.contains(element28)) throw AssertionError() +} + +fun testR0xE29() { + // with possible local optimizations + if (3.toDouble() in 1L until 3L != range0.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in 1L until 3L != !range0.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in 1L until 3L) != !range0.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in 1L until 3L) != range0.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in 1L until 3L != range0.contains(element29)) throw AssertionError() + if (element29 !in 1L until 3L != !range0.contains(element29)) throw AssertionError() + if (!(element29 in 1L until 3L) != !range0.contains(element29)) throw AssertionError() + if (!(element29 !in 1L until 3L) != range0.contains(element29)) throw AssertionError() +} + +fun testR0xE30() { + // with possible local optimizations + if (4.toByte() in 1L until 3L != range0.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 1L until 3L != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 1L until 3L) != !range0.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 1L until 3L) != range0.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in 1L until 3L != range0.contains(element30)) throw AssertionError() + if (element30 !in 1L until 3L != !range0.contains(element30)) throw AssertionError() + if (!(element30 in 1L until 3L) != !range0.contains(element30)) throw AssertionError() + if (!(element30 !in 1L until 3L) != range0.contains(element30)) throw AssertionError() +} + +fun testR0xE31() { + // with possible local optimizations + if (4.toShort() in 1L until 3L != range0.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 1L until 3L != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 1L until 3L) != !range0.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 1L until 3L) != range0.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in 1L until 3L != range0.contains(element31)) throw AssertionError() + if (element31 !in 1L until 3L != !range0.contains(element31)) throw AssertionError() + if (!(element31 in 1L until 3L) != !range0.contains(element31)) throw AssertionError() + if (!(element31 !in 1L until 3L) != range0.contains(element31)) throw AssertionError() +} + +fun testR0xE32() { + // with possible local optimizations + if (4 in 1L until 3L != range0.contains(4)) throw AssertionError() + if (4 !in 1L until 3L != !range0.contains(4)) throw AssertionError() + if (!(4 in 1L until 3L) != !range0.contains(4)) throw AssertionError() + if (!(4 !in 1L until 3L) != range0.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in 1L until 3L != range0.contains(element32)) throw AssertionError() + if (element32 !in 1L until 3L != !range0.contains(element32)) throw AssertionError() + if (!(element32 in 1L until 3L) != !range0.contains(element32)) throw AssertionError() + if (!(element32 !in 1L until 3L) != range0.contains(element32)) throw AssertionError() +} + +fun testR0xE33() { + // with possible local optimizations + if (4.toLong() in 1L until 3L != range0.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in 1L until 3L != !range0.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in 1L until 3L) != !range0.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in 1L until 3L) != range0.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in 1L until 3L != range0.contains(element33)) throw AssertionError() + if (element33 !in 1L until 3L != !range0.contains(element33)) throw AssertionError() + if (!(element33 in 1L until 3L) != !range0.contains(element33)) throw AssertionError() + if (!(element33 !in 1L until 3L) != range0.contains(element33)) throw AssertionError() +} + +fun testR0xE34() { + // with possible local optimizations + if (4.toFloat() in 1L until 3L != range0.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in 1L until 3L != !range0.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in 1L until 3L) != !range0.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in 1L until 3L) != range0.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in 1L until 3L != range0.contains(element34)) throw AssertionError() + if (element34 !in 1L until 3L != !range0.contains(element34)) throw AssertionError() + if (!(element34 in 1L until 3L) != !range0.contains(element34)) throw AssertionError() + if (!(element34 !in 1L until 3L) != range0.contains(element34)) throw AssertionError() +} + +fun testR0xE35() { + // with possible local optimizations + if (4.toDouble() in 1L until 3L != range0.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in 1L until 3L != !range0.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in 1L until 3L) != !range0.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in 1L until 3L) != range0.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in 1L until 3L != range0.contains(element35)) throw AssertionError() + if (element35 !in 1L until 3L != !range0.contains(element35)) throw AssertionError() + if (!(element35 in 1L until 3L) != !range0.contains(element35)) throw AssertionError() + if (!(element35 !in 1L until 3L) != range0.contains(element35)) throw AssertionError() +} + +fun testR1xE0() { + // with possible local optimizations + if ((-1).toByte() in 3L until 1L != range1.contains((-1).toByte())) throw AssertionError() + if ((-1).toByte() !in 3L until 1L != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() in 3L until 1L) != !range1.contains((-1).toByte())) throw AssertionError() + if (!((-1).toByte() !in 3L until 1L) != range1.contains((-1).toByte())) throw AssertionError() + // no local optimizations + if (element0 in 3L until 1L != range1.contains(element0)) throw AssertionError() + if (element0 !in 3L until 1L != !range1.contains(element0)) throw AssertionError() + if (!(element0 in 3L until 1L) != !range1.contains(element0)) throw AssertionError() + if (!(element0 !in 3L until 1L) != range1.contains(element0)) throw AssertionError() +} + +fun testR1xE1() { + // with possible local optimizations + if ((-1).toShort() in 3L until 1L != range1.contains((-1).toShort())) throw AssertionError() + if ((-1).toShort() !in 3L until 1L != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() in 3L until 1L) != !range1.contains((-1).toShort())) throw AssertionError() + if (!((-1).toShort() !in 3L until 1L) != range1.contains((-1).toShort())) throw AssertionError() + // no local optimizations + if (element1 in 3L until 1L != range1.contains(element1)) throw AssertionError() + if (element1 !in 3L until 1L != !range1.contains(element1)) throw AssertionError() + if (!(element1 in 3L until 1L) != !range1.contains(element1)) throw AssertionError() + if (!(element1 !in 3L until 1L) != range1.contains(element1)) throw AssertionError() +} + +fun testR1xE2() { + // with possible local optimizations + if ((-1) in 3L until 1L != range1.contains((-1))) throw AssertionError() + if ((-1) !in 3L until 1L != !range1.contains((-1))) throw AssertionError() + if (!((-1) in 3L until 1L) != !range1.contains((-1))) throw AssertionError() + if (!((-1) !in 3L until 1L) != range1.contains((-1))) throw AssertionError() + // no local optimizations + if (element2 in 3L until 1L != range1.contains(element2)) throw AssertionError() + if (element2 !in 3L until 1L != !range1.contains(element2)) throw AssertionError() + if (!(element2 in 3L until 1L) != !range1.contains(element2)) throw AssertionError() + if (!(element2 !in 3L until 1L) != range1.contains(element2)) throw AssertionError() +} + +fun testR1xE3() { + // with possible local optimizations + if ((-1).toLong() in 3L until 1L != range1.contains((-1).toLong())) throw AssertionError() + if ((-1).toLong() !in 3L until 1L != !range1.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() in 3L until 1L) != !range1.contains((-1).toLong())) throw AssertionError() + if (!((-1).toLong() !in 3L until 1L) != range1.contains((-1).toLong())) throw AssertionError() + // no local optimizations + if (element3 in 3L until 1L != range1.contains(element3)) throw AssertionError() + if (element3 !in 3L until 1L != !range1.contains(element3)) throw AssertionError() + if (!(element3 in 3L until 1L) != !range1.contains(element3)) throw AssertionError() + if (!(element3 !in 3L until 1L) != range1.contains(element3)) throw AssertionError() +} + +fun testR1xE4() { + // with possible local optimizations + if ((-1).toFloat() in 3L until 1L != range1.contains((-1).toFloat())) throw AssertionError() + if ((-1).toFloat() !in 3L until 1L != !range1.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() in 3L until 1L) != !range1.contains((-1).toFloat())) throw AssertionError() + if (!((-1).toFloat() !in 3L until 1L) != range1.contains((-1).toFloat())) throw AssertionError() + // no local optimizations + if (element4 in 3L until 1L != range1.contains(element4)) throw AssertionError() + if (element4 !in 3L until 1L != !range1.contains(element4)) throw AssertionError() + if (!(element4 in 3L until 1L) != !range1.contains(element4)) throw AssertionError() + if (!(element4 !in 3L until 1L) != range1.contains(element4)) throw AssertionError() +} + +fun testR1xE5() { + // with possible local optimizations + if ((-1).toDouble() in 3L until 1L != range1.contains((-1).toDouble())) throw AssertionError() + if ((-1).toDouble() !in 3L until 1L != !range1.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() in 3L until 1L) != !range1.contains((-1).toDouble())) throw AssertionError() + if (!((-1).toDouble() !in 3L until 1L) != range1.contains((-1).toDouble())) throw AssertionError() + // no local optimizations + if (element5 in 3L until 1L != range1.contains(element5)) throw AssertionError() + if (element5 !in 3L until 1L != !range1.contains(element5)) throw AssertionError() + if (!(element5 in 3L until 1L) != !range1.contains(element5)) throw AssertionError() + if (!(element5 !in 3L until 1L) != range1.contains(element5)) throw AssertionError() +} + +fun testR1xE6() { + // with possible local optimizations + if (0.toByte() in 3L until 1L != range1.contains(0.toByte())) throw AssertionError() + if (0.toByte() !in 3L until 1L != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() in 3L until 1L) != !range1.contains(0.toByte())) throw AssertionError() + if (!(0.toByte() !in 3L until 1L) != range1.contains(0.toByte())) throw AssertionError() + // no local optimizations + if (element6 in 3L until 1L != range1.contains(element6)) throw AssertionError() + if (element6 !in 3L until 1L != !range1.contains(element6)) throw AssertionError() + if (!(element6 in 3L until 1L) != !range1.contains(element6)) throw AssertionError() + if (!(element6 !in 3L until 1L) != range1.contains(element6)) throw AssertionError() +} + +fun testR1xE7() { + // with possible local optimizations + if (0.toShort() in 3L until 1L != range1.contains(0.toShort())) throw AssertionError() + if (0.toShort() !in 3L until 1L != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() in 3L until 1L) != !range1.contains(0.toShort())) throw AssertionError() + if (!(0.toShort() !in 3L until 1L) != range1.contains(0.toShort())) throw AssertionError() + // no local optimizations + if (element7 in 3L until 1L != range1.contains(element7)) throw AssertionError() + if (element7 !in 3L until 1L != !range1.contains(element7)) throw AssertionError() + if (!(element7 in 3L until 1L) != !range1.contains(element7)) throw AssertionError() + if (!(element7 !in 3L until 1L) != range1.contains(element7)) throw AssertionError() +} + +fun testR1xE8() { + // with possible local optimizations + if (0 in 3L until 1L != range1.contains(0)) throw AssertionError() + if (0 !in 3L until 1L != !range1.contains(0)) throw AssertionError() + if (!(0 in 3L until 1L) != !range1.contains(0)) throw AssertionError() + if (!(0 !in 3L until 1L) != range1.contains(0)) throw AssertionError() + // no local optimizations + if (element8 in 3L until 1L != range1.contains(element8)) throw AssertionError() + if (element8 !in 3L until 1L != !range1.contains(element8)) throw AssertionError() + if (!(element8 in 3L until 1L) != !range1.contains(element8)) throw AssertionError() + if (!(element8 !in 3L until 1L) != range1.contains(element8)) throw AssertionError() +} + +fun testR1xE9() { + // with possible local optimizations + if (0.toLong() in 3L until 1L != range1.contains(0.toLong())) throw AssertionError() + if (0.toLong() !in 3L until 1L != !range1.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() in 3L until 1L) != !range1.contains(0.toLong())) throw AssertionError() + if (!(0.toLong() !in 3L until 1L) != range1.contains(0.toLong())) throw AssertionError() + // no local optimizations + if (element9 in 3L until 1L != range1.contains(element9)) throw AssertionError() + if (element9 !in 3L until 1L != !range1.contains(element9)) throw AssertionError() + if (!(element9 in 3L until 1L) != !range1.contains(element9)) throw AssertionError() + if (!(element9 !in 3L until 1L) != range1.contains(element9)) throw AssertionError() +} + +fun testR1xE10() { + // with possible local optimizations + if (0.toFloat() in 3L until 1L != range1.contains(0.toFloat())) throw AssertionError() + if (0.toFloat() !in 3L until 1L != !range1.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() in 3L until 1L) != !range1.contains(0.toFloat())) throw AssertionError() + if (!(0.toFloat() !in 3L until 1L) != range1.contains(0.toFloat())) throw AssertionError() + // no local optimizations + if (element10 in 3L until 1L != range1.contains(element10)) throw AssertionError() + if (element10 !in 3L until 1L != !range1.contains(element10)) throw AssertionError() + if (!(element10 in 3L until 1L) != !range1.contains(element10)) throw AssertionError() + if (!(element10 !in 3L until 1L) != range1.contains(element10)) throw AssertionError() +} + +fun testR1xE11() { + // with possible local optimizations + if (0.toDouble() in 3L until 1L != range1.contains(0.toDouble())) throw AssertionError() + if (0.toDouble() !in 3L until 1L != !range1.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() in 3L until 1L) != !range1.contains(0.toDouble())) throw AssertionError() + if (!(0.toDouble() !in 3L until 1L) != range1.contains(0.toDouble())) throw AssertionError() + // no local optimizations + if (element11 in 3L until 1L != range1.contains(element11)) throw AssertionError() + if (element11 !in 3L until 1L != !range1.contains(element11)) throw AssertionError() + if (!(element11 in 3L until 1L) != !range1.contains(element11)) throw AssertionError() + if (!(element11 !in 3L until 1L) != range1.contains(element11)) throw AssertionError() +} + +fun testR1xE12() { + // with possible local optimizations + if (1.toByte() in 3L until 1L != range1.contains(1.toByte())) throw AssertionError() + if (1.toByte() !in 3L until 1L != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() in 3L until 1L) != !range1.contains(1.toByte())) throw AssertionError() + if (!(1.toByte() !in 3L until 1L) != range1.contains(1.toByte())) throw AssertionError() + // no local optimizations + if (element12 in 3L until 1L != range1.contains(element12)) throw AssertionError() + if (element12 !in 3L until 1L != !range1.contains(element12)) throw AssertionError() + if (!(element12 in 3L until 1L) != !range1.contains(element12)) throw AssertionError() + if (!(element12 !in 3L until 1L) != range1.contains(element12)) throw AssertionError() +} + +fun testR1xE13() { + // with possible local optimizations + if (1.toShort() in 3L until 1L != range1.contains(1.toShort())) throw AssertionError() + if (1.toShort() !in 3L until 1L != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() in 3L until 1L) != !range1.contains(1.toShort())) throw AssertionError() + if (!(1.toShort() !in 3L until 1L) != range1.contains(1.toShort())) throw AssertionError() + // no local optimizations + if (element13 in 3L until 1L != range1.contains(element13)) throw AssertionError() + if (element13 !in 3L until 1L != !range1.contains(element13)) throw AssertionError() + if (!(element13 in 3L until 1L) != !range1.contains(element13)) throw AssertionError() + if (!(element13 !in 3L until 1L) != range1.contains(element13)) throw AssertionError() +} + +fun testR1xE14() { + // with possible local optimizations + if (1 in 3L until 1L != range1.contains(1)) throw AssertionError() + if (1 !in 3L until 1L != !range1.contains(1)) throw AssertionError() + if (!(1 in 3L until 1L) != !range1.contains(1)) throw AssertionError() + if (!(1 !in 3L until 1L) != range1.contains(1)) throw AssertionError() + // no local optimizations + if (element14 in 3L until 1L != range1.contains(element14)) throw AssertionError() + if (element14 !in 3L until 1L != !range1.contains(element14)) throw AssertionError() + if (!(element14 in 3L until 1L) != !range1.contains(element14)) throw AssertionError() + if (!(element14 !in 3L until 1L) != range1.contains(element14)) throw AssertionError() +} + +fun testR1xE15() { + // with possible local optimizations + if (1.toLong() in 3L until 1L != range1.contains(1.toLong())) throw AssertionError() + if (1.toLong() !in 3L until 1L != !range1.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() in 3L until 1L) != !range1.contains(1.toLong())) throw AssertionError() + if (!(1.toLong() !in 3L until 1L) != range1.contains(1.toLong())) throw AssertionError() + // no local optimizations + if (element15 in 3L until 1L != range1.contains(element15)) throw AssertionError() + if (element15 !in 3L until 1L != !range1.contains(element15)) throw AssertionError() + if (!(element15 in 3L until 1L) != !range1.contains(element15)) throw AssertionError() + if (!(element15 !in 3L until 1L) != range1.contains(element15)) throw AssertionError() +} + +fun testR1xE16() { + // with possible local optimizations + if (1.toFloat() in 3L until 1L != range1.contains(1.toFloat())) throw AssertionError() + if (1.toFloat() !in 3L until 1L != !range1.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() in 3L until 1L) != !range1.contains(1.toFloat())) throw AssertionError() + if (!(1.toFloat() !in 3L until 1L) != range1.contains(1.toFloat())) throw AssertionError() + // no local optimizations + if (element16 in 3L until 1L != range1.contains(element16)) throw AssertionError() + if (element16 !in 3L until 1L != !range1.contains(element16)) throw AssertionError() + if (!(element16 in 3L until 1L) != !range1.contains(element16)) throw AssertionError() + if (!(element16 !in 3L until 1L) != range1.contains(element16)) throw AssertionError() +} + +fun testR1xE17() { + // with possible local optimizations + if (1.toDouble() in 3L until 1L != range1.contains(1.toDouble())) throw AssertionError() + if (1.toDouble() !in 3L until 1L != !range1.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() in 3L until 1L) != !range1.contains(1.toDouble())) throw AssertionError() + if (!(1.toDouble() !in 3L until 1L) != range1.contains(1.toDouble())) throw AssertionError() + // no local optimizations + if (element17 in 3L until 1L != range1.contains(element17)) throw AssertionError() + if (element17 !in 3L until 1L != !range1.contains(element17)) throw AssertionError() + if (!(element17 in 3L until 1L) != !range1.contains(element17)) throw AssertionError() + if (!(element17 !in 3L until 1L) != range1.contains(element17)) throw AssertionError() +} + +fun testR1xE18() { + // with possible local optimizations + if (2.toByte() in 3L until 1L != range1.contains(2.toByte())) throw AssertionError() + if (2.toByte() !in 3L until 1L != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() in 3L until 1L) != !range1.contains(2.toByte())) throw AssertionError() + if (!(2.toByte() !in 3L until 1L) != range1.contains(2.toByte())) throw AssertionError() + // no local optimizations + if (element18 in 3L until 1L != range1.contains(element18)) throw AssertionError() + if (element18 !in 3L until 1L != !range1.contains(element18)) throw AssertionError() + if (!(element18 in 3L until 1L) != !range1.contains(element18)) throw AssertionError() + if (!(element18 !in 3L until 1L) != range1.contains(element18)) throw AssertionError() +} + +fun testR1xE19() { + // with possible local optimizations + if (2.toShort() in 3L until 1L != range1.contains(2.toShort())) throw AssertionError() + if (2.toShort() !in 3L until 1L != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() in 3L until 1L) != !range1.contains(2.toShort())) throw AssertionError() + if (!(2.toShort() !in 3L until 1L) != range1.contains(2.toShort())) throw AssertionError() + // no local optimizations + if (element19 in 3L until 1L != range1.contains(element19)) throw AssertionError() + if (element19 !in 3L until 1L != !range1.contains(element19)) throw AssertionError() + if (!(element19 in 3L until 1L) != !range1.contains(element19)) throw AssertionError() + if (!(element19 !in 3L until 1L) != range1.contains(element19)) throw AssertionError() +} + +fun testR1xE20() { + // with possible local optimizations + if (2 in 3L until 1L != range1.contains(2)) throw AssertionError() + if (2 !in 3L until 1L != !range1.contains(2)) throw AssertionError() + if (!(2 in 3L until 1L) != !range1.contains(2)) throw AssertionError() + if (!(2 !in 3L until 1L) != range1.contains(2)) throw AssertionError() + // no local optimizations + if (element20 in 3L until 1L != range1.contains(element20)) throw AssertionError() + if (element20 !in 3L until 1L != !range1.contains(element20)) throw AssertionError() + if (!(element20 in 3L until 1L) != !range1.contains(element20)) throw AssertionError() + if (!(element20 !in 3L until 1L) != range1.contains(element20)) throw AssertionError() +} + +fun testR1xE21() { + // with possible local optimizations + if (2.toLong() in 3L until 1L != range1.contains(2.toLong())) throw AssertionError() + if (2.toLong() !in 3L until 1L != !range1.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() in 3L until 1L) != !range1.contains(2.toLong())) throw AssertionError() + if (!(2.toLong() !in 3L until 1L) != range1.contains(2.toLong())) throw AssertionError() + // no local optimizations + if (element21 in 3L until 1L != range1.contains(element21)) throw AssertionError() + if (element21 !in 3L until 1L != !range1.contains(element21)) throw AssertionError() + if (!(element21 in 3L until 1L) != !range1.contains(element21)) throw AssertionError() + if (!(element21 !in 3L until 1L) != range1.contains(element21)) throw AssertionError() +} + +fun testR1xE22() { + // with possible local optimizations + if (2.toFloat() in 3L until 1L != range1.contains(2.toFloat())) throw AssertionError() + if (2.toFloat() !in 3L until 1L != !range1.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() in 3L until 1L) != !range1.contains(2.toFloat())) throw AssertionError() + if (!(2.toFloat() !in 3L until 1L) != range1.contains(2.toFloat())) throw AssertionError() + // no local optimizations + if (element22 in 3L until 1L != range1.contains(element22)) throw AssertionError() + if (element22 !in 3L until 1L != !range1.contains(element22)) throw AssertionError() + if (!(element22 in 3L until 1L) != !range1.contains(element22)) throw AssertionError() + if (!(element22 !in 3L until 1L) != range1.contains(element22)) throw AssertionError() +} + +fun testR1xE23() { + // with possible local optimizations + if (2.toDouble() in 3L until 1L != range1.contains(2.toDouble())) throw AssertionError() + if (2.toDouble() !in 3L until 1L != !range1.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() in 3L until 1L) != !range1.contains(2.toDouble())) throw AssertionError() + if (!(2.toDouble() !in 3L until 1L) != range1.contains(2.toDouble())) throw AssertionError() + // no local optimizations + if (element23 in 3L until 1L != range1.contains(element23)) throw AssertionError() + if (element23 !in 3L until 1L != !range1.contains(element23)) throw AssertionError() + if (!(element23 in 3L until 1L) != !range1.contains(element23)) throw AssertionError() + if (!(element23 !in 3L until 1L) != range1.contains(element23)) throw AssertionError() +} + +fun testR1xE24() { + // with possible local optimizations + if (3.toByte() in 3L until 1L != range1.contains(3.toByte())) throw AssertionError() + if (3.toByte() !in 3L until 1L != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() in 3L until 1L) != !range1.contains(3.toByte())) throw AssertionError() + if (!(3.toByte() !in 3L until 1L) != range1.contains(3.toByte())) throw AssertionError() + // no local optimizations + if (element24 in 3L until 1L != range1.contains(element24)) throw AssertionError() + if (element24 !in 3L until 1L != !range1.contains(element24)) throw AssertionError() + if (!(element24 in 3L until 1L) != !range1.contains(element24)) throw AssertionError() + if (!(element24 !in 3L until 1L) != range1.contains(element24)) throw AssertionError() +} + +fun testR1xE25() { + // with possible local optimizations + if (3.toShort() in 3L until 1L != range1.contains(3.toShort())) throw AssertionError() + if (3.toShort() !in 3L until 1L != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() in 3L until 1L) != !range1.contains(3.toShort())) throw AssertionError() + if (!(3.toShort() !in 3L until 1L) != range1.contains(3.toShort())) throw AssertionError() + // no local optimizations + if (element25 in 3L until 1L != range1.contains(element25)) throw AssertionError() + if (element25 !in 3L until 1L != !range1.contains(element25)) throw AssertionError() + if (!(element25 in 3L until 1L) != !range1.contains(element25)) throw AssertionError() + if (!(element25 !in 3L until 1L) != range1.contains(element25)) throw AssertionError() +} + +fun testR1xE26() { + // with possible local optimizations + if (3 in 3L until 1L != range1.contains(3)) throw AssertionError() + if (3 !in 3L until 1L != !range1.contains(3)) throw AssertionError() + if (!(3 in 3L until 1L) != !range1.contains(3)) throw AssertionError() + if (!(3 !in 3L until 1L) != range1.contains(3)) throw AssertionError() + // no local optimizations + if (element26 in 3L until 1L != range1.contains(element26)) throw AssertionError() + if (element26 !in 3L until 1L != !range1.contains(element26)) throw AssertionError() + if (!(element26 in 3L until 1L) != !range1.contains(element26)) throw AssertionError() + if (!(element26 !in 3L until 1L) != range1.contains(element26)) throw AssertionError() +} + +fun testR1xE27() { + // with possible local optimizations + if (3.toLong() in 3L until 1L != range1.contains(3.toLong())) throw AssertionError() + if (3.toLong() !in 3L until 1L != !range1.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() in 3L until 1L) != !range1.contains(3.toLong())) throw AssertionError() + if (!(3.toLong() !in 3L until 1L) != range1.contains(3.toLong())) throw AssertionError() + // no local optimizations + if (element27 in 3L until 1L != range1.contains(element27)) throw AssertionError() + if (element27 !in 3L until 1L != !range1.contains(element27)) throw AssertionError() + if (!(element27 in 3L until 1L) != !range1.contains(element27)) throw AssertionError() + if (!(element27 !in 3L until 1L) != range1.contains(element27)) throw AssertionError() +} + +fun testR1xE28() { + // with possible local optimizations + if (3.toFloat() in 3L until 1L != range1.contains(3.toFloat())) throw AssertionError() + if (3.toFloat() !in 3L until 1L != !range1.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() in 3L until 1L) != !range1.contains(3.toFloat())) throw AssertionError() + if (!(3.toFloat() !in 3L until 1L) != range1.contains(3.toFloat())) throw AssertionError() + // no local optimizations + if (element28 in 3L until 1L != range1.contains(element28)) throw AssertionError() + if (element28 !in 3L until 1L != !range1.contains(element28)) throw AssertionError() + if (!(element28 in 3L until 1L) != !range1.contains(element28)) throw AssertionError() + if (!(element28 !in 3L until 1L) != range1.contains(element28)) throw AssertionError() +} + +fun testR1xE29() { + // with possible local optimizations + if (3.toDouble() in 3L until 1L != range1.contains(3.toDouble())) throw AssertionError() + if (3.toDouble() !in 3L until 1L != !range1.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() in 3L until 1L) != !range1.contains(3.toDouble())) throw AssertionError() + if (!(3.toDouble() !in 3L until 1L) != range1.contains(3.toDouble())) throw AssertionError() + // no local optimizations + if (element29 in 3L until 1L != range1.contains(element29)) throw AssertionError() + if (element29 !in 3L until 1L != !range1.contains(element29)) throw AssertionError() + if (!(element29 in 3L until 1L) != !range1.contains(element29)) throw AssertionError() + if (!(element29 !in 3L until 1L) != range1.contains(element29)) throw AssertionError() +} + +fun testR1xE30() { + // with possible local optimizations + if (4.toByte() in 3L until 1L != range1.contains(4.toByte())) throw AssertionError() + if (4.toByte() !in 3L until 1L != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() in 3L until 1L) != !range1.contains(4.toByte())) throw AssertionError() + if (!(4.toByte() !in 3L until 1L) != range1.contains(4.toByte())) throw AssertionError() + // no local optimizations + if (element30 in 3L until 1L != range1.contains(element30)) throw AssertionError() + if (element30 !in 3L until 1L != !range1.contains(element30)) throw AssertionError() + if (!(element30 in 3L until 1L) != !range1.contains(element30)) throw AssertionError() + if (!(element30 !in 3L until 1L) != range1.contains(element30)) throw AssertionError() +} + +fun testR1xE31() { + // with possible local optimizations + if (4.toShort() in 3L until 1L != range1.contains(4.toShort())) throw AssertionError() + if (4.toShort() !in 3L until 1L != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() in 3L until 1L) != !range1.contains(4.toShort())) throw AssertionError() + if (!(4.toShort() !in 3L until 1L) != range1.contains(4.toShort())) throw AssertionError() + // no local optimizations + if (element31 in 3L until 1L != range1.contains(element31)) throw AssertionError() + if (element31 !in 3L until 1L != !range1.contains(element31)) throw AssertionError() + if (!(element31 in 3L until 1L) != !range1.contains(element31)) throw AssertionError() + if (!(element31 !in 3L until 1L) != range1.contains(element31)) throw AssertionError() +} + +fun testR1xE32() { + // with possible local optimizations + if (4 in 3L until 1L != range1.contains(4)) throw AssertionError() + if (4 !in 3L until 1L != !range1.contains(4)) throw AssertionError() + if (!(4 in 3L until 1L) != !range1.contains(4)) throw AssertionError() + if (!(4 !in 3L until 1L) != range1.contains(4)) throw AssertionError() + // no local optimizations + if (element32 in 3L until 1L != range1.contains(element32)) throw AssertionError() + if (element32 !in 3L until 1L != !range1.contains(element32)) throw AssertionError() + if (!(element32 in 3L until 1L) != !range1.contains(element32)) throw AssertionError() + if (!(element32 !in 3L until 1L) != range1.contains(element32)) throw AssertionError() +} + +fun testR1xE33() { + // with possible local optimizations + if (4.toLong() in 3L until 1L != range1.contains(4.toLong())) throw AssertionError() + if (4.toLong() !in 3L until 1L != !range1.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() in 3L until 1L) != !range1.contains(4.toLong())) throw AssertionError() + if (!(4.toLong() !in 3L until 1L) != range1.contains(4.toLong())) throw AssertionError() + // no local optimizations + if (element33 in 3L until 1L != range1.contains(element33)) throw AssertionError() + if (element33 !in 3L until 1L != !range1.contains(element33)) throw AssertionError() + if (!(element33 in 3L until 1L) != !range1.contains(element33)) throw AssertionError() + if (!(element33 !in 3L until 1L) != range1.contains(element33)) throw AssertionError() +} + +fun testR1xE34() { + // with possible local optimizations + if (4.toFloat() in 3L until 1L != range1.contains(4.toFloat())) throw AssertionError() + if (4.toFloat() !in 3L until 1L != !range1.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() in 3L until 1L) != !range1.contains(4.toFloat())) throw AssertionError() + if (!(4.toFloat() !in 3L until 1L) != range1.contains(4.toFloat())) throw AssertionError() + // no local optimizations + if (element34 in 3L until 1L != range1.contains(element34)) throw AssertionError() + if (element34 !in 3L until 1L != !range1.contains(element34)) throw AssertionError() + if (!(element34 in 3L until 1L) != !range1.contains(element34)) throw AssertionError() + if (!(element34 !in 3L until 1L) != range1.contains(element34)) throw AssertionError() +} + +fun testR1xE35() { + // with possible local optimizations + if (4.toDouble() in 3L until 1L != range1.contains(4.toDouble())) throw AssertionError() + if (4.toDouble() !in 3L until 1L != !range1.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() in 3L until 1L) != !range1.contains(4.toDouble())) throw AssertionError() + if (!(4.toDouble() !in 3L until 1L) != range1.contains(4.toDouble())) throw AssertionError() + // no local optimizations + if (element35 in 3L until 1L != range1.contains(element35)) throw AssertionError() + if (element35 !in 3L until 1L != !range1.contains(element35)) throw AssertionError() + if (!(element35 in 3L until 1L) != !range1.contains(element35)) throw AssertionError() + if (!(element35 !in 3L until 1L) != range1.contains(element35)) throw AssertionError() +} + + diff --git a/backend.native/tests/external/codegen/box/ranges/contains/inArray.kt b/backend.native/tests/external/codegen/box/ranges/contains/inArray.kt new file mode 100644 index 00000000000..496d9095a00 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/inArray.kt @@ -0,0 +1,7 @@ +// WITH_RUNTIME + +fun box(): String = when { + 0 in intArrayOf(1, 2, 3) -> "fail 1" + 1 !in intArrayOf(1, 2, 3) -> "fail 2" + else -> "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/ranges/contains/inCharSequence.kt b/backend.native/tests/external/codegen/box/ranges/contains/inCharSequence.kt new file mode 100644 index 00000000000..56b17a69f6f --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/inCharSequence.kt @@ -0,0 +1,9 @@ +// WITH_RUNTIME + +val charSeq: String = "123" + +fun box(): String = when { + '0' in charSeq -> "fail 1" + '1' !in charSeq -> "fail 2" + else -> "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/ranges/contains/inCustomObjectRange.kt b/backend.native/tests/external/codegen/box/ranges/contains/inCustomObjectRange.kt new file mode 100644 index 00000000000..c52fda80d82 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/inCustomObjectRange.kt @@ -0,0 +1,22 @@ +// WITH_RUNTIME + +class A(val z: Int) : Comparable { + override fun compareTo(other: A): Int { + return z.compareTo(other.z) + } +} + +operator fun A.rangeTo(that: A): ClosedRange = object: ClosedRange { + override val endInclusive: A + get() = that + override val start: A + get() = this@rangeTo +} + +operator fun ClosedRange.iterator() = (start.z..endInclusive.z).map { A(it) }.iterator() + +fun box(): String { + if (!( A(2) in A(1)..A(12) )) return "Fail 1" + if ( A(2) !in A(1)..A(12) ) return "Fail 2" + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/ranges/contains/inDoubleRangeLiteralVsComparableRangeLiteral.kt b/backend.native/tests/external/codegen/box/ranges/contains/inDoubleRangeLiteralVsComparableRangeLiteral.kt new file mode 100644 index 00000000000..824d7ef428f --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/inDoubleRangeLiteralVsComparableRangeLiteral.kt @@ -0,0 +1,22 @@ +// IGNORE_BACKEND: JS +// WITH_RUNTIME + +val DOUBLE_RANGE = 0.0 .. -0.0 + +val PZERO = 0.0 as Comparable +val NZERO = -0.0 as Comparable +val COMPARABLE_RANGE = PZERO .. NZERO + +fun box(): String { + if (!(0.0 in DOUBLE_RANGE)) return "fail 1 in Double" + if (0.0 !in DOUBLE_RANGE) return "fail 1 !in Double" + if (!(-0.0 in DOUBLE_RANGE)) return "fail 2 in Double" + if (-0.0 !in DOUBLE_RANGE) return "fail 2 !in Double" + + if (PZERO in COMPARABLE_RANGE) return "fail 3 in Comparable" + if (!(PZERO !in COMPARABLE_RANGE)) return "fail 3 !in Comparable" + if (NZERO in COMPARABLE_RANGE) return "fail 4 in Comparable" + if (!(NZERO !in COMPARABLE_RANGE)) return "fail 4a !in Comparable" + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/ranges/contains/inIterable.kt b/backend.native/tests/external/codegen/box/ranges/contains/inIterable.kt new file mode 100644 index 00000000000..8a418e12d1a --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/inIterable.kt @@ -0,0 +1,9 @@ +// WITH_RUNTIME + +val iterable: Iterable = listOf(1, 2, 3) + +fun box(): String = when { + 0 in iterable -> "fail 1" + 1 !in iterable -> "fail 2" + else -> "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/ranges/contains/inNonMatchingRange.kt b/backend.native/tests/external/codegen/box/ranges/contains/inNonMatchingRange.kt new file mode 100644 index 00000000000..53c3c656980 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/inNonMatchingRange.kt @@ -0,0 +1,55 @@ +// WITH_RUNTIME + +fun inInt(x: Long): Boolean { + return x in 1..2 +} + +fun notInInt(x: Long): Boolean { + return x !in 1..2 +} + +fun inLong(x: Int): Boolean { + return x in 1L..2L +} + +fun notInLong(x: Int): Boolean { + return x !in 1L..2L +} + +fun inFloat(x: Double): Boolean { + return x in 1.0f..2.0f +} + +fun notInFloat(x: Double): Boolean { + return x !in 1.0f..2.0f +} + +fun inDouble(x: Float): Boolean { + return x in 1.0..2.0 +} + +fun notInDouble(x: Float): Boolean { + return x !in 1.0..2.0 +} + +fun box(): String { + return when { + !inInt(1L) -> "Fail !inInt" + inInt(0L) -> "Fail inInt" + notInInt(1L) -> "Fail notInInt" + !notInInt(0L) -> "Fail !notInInt" + !inLong(1) -> "Fail !inLong" + inLong(0) -> "Fail inLong" + notInLong(1) -> "Fail notInLong" + !notInLong(0) -> "Fail !notInLong" + !inFloat(1.0) -> "Fain !inFloat" + inFloat(0.0) -> "Fain inFloat" + notInFloat(1.0) -> "Fail notInFloat" + !notInFloat(0.0) -> "Fail !notInFloat" + !inDouble(1.0F) -> "Fail !inDouble" + inDouble(0.0F) -> "Fail inDouble" + notInDouble(1.0F) -> "Fail notInDouble" + !notInDouble(0.0F) -> "Fail !notInDouble" + else -> "OK" + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/ranges/contains/inPrimitiveProgression.kt b/backend.native/tests/external/codegen/box/ranges/contains/inPrimitiveProgression.kt new file mode 100644 index 00000000000..96f588d5b97 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/inPrimitiveProgression.kt @@ -0,0 +1,9 @@ +// WITH_RUNTIME + +val progression = 1 .. 3 step 2 + +fun box(): String = when { + 0 in progression -> "fail 1" + 1 !in progression -> "fail 2" + else -> "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/ranges/contains/inPrimitiveRange.kt b/backend.native/tests/external/codegen/box/ranges/contains/inPrimitiveRange.kt new file mode 100644 index 00000000000..2113dca0c54 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/inPrimitiveRange.kt @@ -0,0 +1,9 @@ +// WITH_RUNTIME + +val range = 1 .. 3 + +fun box(): String = when { + 0 in range -> "fail 1" + 1 !in range -> "fail 2" + else -> "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/ranges/contains/inRangeLiteralComposition.kt b/backend.native/tests/external/codegen/box/ranges/contains/inRangeLiteralComposition.kt new file mode 100644 index 00000000000..2e086ceafcd --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/inRangeLiteralComposition.kt @@ -0,0 +1,27 @@ +// WITH_RUNTIME + +val i1 = 1 +val i2 = 2 +val i3 = 3 + +fun box(): String { + if (!(i2 in i1 .. i3 && i1 !in i2 .. i3)) return "Fail 1 &&" + if (!(i2 in i1 .. i3 || i1 !in i2 .. i3)) return "Fail 1 ||" + + // const-folded in JVM BE + if (!(2 in 1 .. 3 && 1 !in 2 .. 3)) return "Fail 2 &&" + if (!(2 in 1 .. 3 || 1 !in 2 .. 3)) return "Fail 2 ||" + + val xs = listOf(1, 2, 3) + if (!(1 in xs && 10 !in xs)) return "Fail 3 &&" + if (!(1 in xs || 10 !in xs)) return "Fail 3 ||" + + val iarr = intArrayOf(1, 2, 3) + if (!(1 in iarr && 10 !in iarr)) return "Fail 4 &&" + if (!(1 in iarr || 10 !in iarr)) return "Fail 4 ||" + + if (!("b" in "a" .. "c" && "a" !in "b" .. "c")) return "Fail 5 &&" + if (!("b" in "a" .. "c" || "a" !in "b" .. "c")) return "Fail 5 ||" + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/ranges/contains/inUntil.kt b/backend.native/tests/external/codegen/box/ranges/contains/inUntil.kt new file mode 100644 index 00000000000..126dd80728c --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/inUntil.kt @@ -0,0 +1,29 @@ +// WITH_RUNTIME + +fun box(): String { + if (!(1 in 0 until 10)) return "Fail 1 in" + if (1 !in 0 until 10) return "Fail 1 !in" + + if (10 in 0 until 10) return "Fail 2 in" + if (!(10 !in 0 until 10)) return "Fail 2 !in" + + if (!(1.toByte() in 0.toByte() until 10.toByte())) return "Fail 1 in Byte" + if (1.toByte() !in 0.toByte() until 10.toByte()) return "Fail 1 !in Byte" + + if (10.toByte() in 0.toByte() until 10.toByte()) return "Fail 2 in Byte" + if (!(10.toByte() !in 0.toByte() until 10.toByte())) return "Fail 2 !in Byte" + + if (!(1.toShort() in 0.toShort() until 10.toShort())) return "Fail 1 in Short" + if (1.toShort() !in 0.toShort() until 10.toShort()) return "Fail 1 !in Short" + + if (10.toShort() in 0.toShort() until 10.toShort()) return "Fail 2 in Short" + if (!(10.toShort() !in 0.toShort() until 10.toShort())) return "Fail 2 !in Short" + + if (!(1.toLong() in 0.toLong() until 10.toLong())) return "Fail 1 in Long" + if (1.toLong() !in 0.toLong() until 10.toLong()) return "Fail 1 !in Long" + + if (10.toLong() in 0.toLong() until 10.toLong()) return "Fail 2 in Long" + if (!(10.toLong() !in 0.toLong() until 10.toLong())) return "Fail 2 !in Long" + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/ranges/contains/kt20106.kt b/backend.native/tests/external/codegen/box/ranges/contains/kt20106.kt new file mode 100644 index 00000000000..2b2097f1e04 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/kt20106.kt @@ -0,0 +1,7 @@ +// WITH_RUNTIME + +fun box(): String { + val strSet = setOf("a", "b") + val xx = "a" to ("a" in strSet) + return if (!xx.second) "fail" else "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/ranges/contains/nullableInPrimitiveRange.kt b/backend.native/tests/external/codegen/box/ranges/contains/nullableInPrimitiveRange.kt new file mode 100644 index 00000000000..fd05c2601f9 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/contains/nullableInPrimitiveRange.kt @@ -0,0 +1,14 @@ +// WITH_RUNTIME + +val x: Int? = 42 +val n: Int? = null + +fun box(): String { + if (x in 0..2) return "Fail in" + if (!(x !in 0..2)) return "Fail !in" + + if (n in 0..2) return "Fail in null" + if (!(n !in 0..2)) return "Fail !in null" + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/ranges/forInIndices/indexOfLast.kt b/backend.native/tests/external/codegen/box/ranges/forInIndices/indexOfLast.kt new file mode 100644 index 00000000000..4d776ba833e --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/forInIndices/indexOfLast.kt @@ -0,0 +1,23 @@ +// WITH_RUNTIME + +import kotlin.test.assertEquals + +inline fun Array.indexOfLast(predicate: (T) -> Boolean): Int { + for (index in indices.reversed()) { + if (predicate(this[index])) { + return index + } + } + return -1 +} + +val ints = arrayOf(1, 2, 3, 2, 1) + +fun box(): String { + assertEquals(-1, ints.indexOfLast { it == 4 }) + assertEquals(4, ints.indexOfLast { it == 1 }) + assertEquals(3, ints.indexOfLast { it == 2 }) + assertEquals(2, ints.indexOfLast { it == 3 }) + assertEquals(-1, ints.indexOfLast { it == 0 }) + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/ranges/forInRangeLiteralWithMixedTypeBounds.kt b/backend.native/tests/external/codegen/box/ranges/forInRangeLiteralWithMixedTypeBounds.kt new file mode 100644 index 00000000000..0fdbe711937 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/forInRangeLiteralWithMixedTypeBounds.kt @@ -0,0 +1,39 @@ +fun test1(): Long { + var s = 0L + for (i in 1L..4) { + s = s * 10 + i + } + return s +} + +fun test2(): Long { + var s = 0L + for (i in 1L..4.toShort()) { + s = s * 10 + i + } + return s +} + +fun testLI(a: Long, b: Int): Long { + var s = 0L + for (i in a..b) { + s = s * 10 + i + } + return s +} + +fun testLS(a: Long, b: Short): Long { + var s = 0L + for (i in a..b) { + s = s * 10 + i + } + return s +} + +fun box(): String { + if (test1() != 1234L) return "Fail 1" + if (test2() != 1234L) return "Fail 1" + if (testLI(1L, 4) != 1234L) return "Fail 2" + if (testLS(1L, 4.toShort()) != 1234L) return "Fail 2" + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/ranges/forInRangeToConstWithOverflow.kt b/backend.native/tests/external/codegen/box/ranges/forInRangeToConstWithOverflow.kt new file mode 100644 index 00000000000..b5cce712005 --- /dev/null +++ b/backend.native/tests/external/codegen/box/ranges/forInRangeToConstWithOverflow.kt @@ -0,0 +1,12 @@ +const val M = Int.MAX_VALUE + +fun box(): String { + var step = 0 + for (i in M .. M) { + ++step + if (step > 1) throw AssertionError("Should be executed once") + } + if (step != 1) throw AssertionError("Should be executed once") + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/reflection/annotations/openSuspendFun.kt b/backend.native/tests/external/codegen/box/reflection/annotations/openSuspendFun.kt new file mode 100644 index 00000000000..36e5bb880c6 --- /dev/null +++ b/backend.native/tests/external/codegen/box/reflection/annotations/openSuspendFun.kt @@ -0,0 +1,28 @@ +// WITH_REFLECT +// IGNORE_BACKEND: JS, NATIVE + +import kotlin.reflect.full.declaredMemberFunctions +import kotlin.test.assertEquals +import kotlin.test.assertTrue + +annotation class Anno + +open class Aaa { + @Anno + suspend open fun aaa() {} +} + +class Bbb { + @Anno + suspend fun bbb() {} +} + +fun box(): String { + val bbb = Bbb::class.declaredMemberFunctions.first { it.name == "bbb" }.annotations + assertEquals(1, bbb.size) + assertTrue(bbb.single() is Anno) + val aaa = Aaa::class.declaredMemberFunctions.first { it.name == "aaa" }.annotations + assertEquals(1, aaa.size) + assertTrue(aaa.single() is Anno) + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/reflection/annotations/privateAnnotation.kt b/backend.native/tests/external/codegen/box/reflection/annotations/privateAnnotation.kt new file mode 100644 index 00000000000..38296e54dac --- /dev/null +++ b/backend.native/tests/external/codegen/box/reflection/annotations/privateAnnotation.kt @@ -0,0 +1,14 @@ +// IGNORE_BACKEND: JS, NATIVE +// WITH_REFLECT + +annotation private class Ann(val name: String) + +class A { + @Ann("OK") + fun foo() {} +} + +fun box(): String { + val ann = A::class.members.single { it.name == "foo" }.annotations.single() as Ann + return ann.name +} diff --git a/backend.native/tests/external/codegen/box/reflection/call/callPrivateJavaMethod.kt b/backend.native/tests/external/codegen/box/reflection/call/callPrivateJavaMethod.kt index 1d2c454b234..886689a585d 100644 --- a/backend.native/tests/external/codegen/box/reflection/call/callPrivateJavaMethod.kt +++ b/backend.native/tests/external/codegen/box/reflection/call/callPrivateJavaMethod.kt @@ -18,7 +18,7 @@ public class J { // FILE: K.kt -import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.reflect.jvm.* import kotlin.test.* diff --git a/backend.native/tests/external/codegen/box/reflection/call/disallowNullValueForNotNullField.kt b/backend.native/tests/external/codegen/box/reflection/call/disallowNullValueForNotNullField.kt index 3463a49c85a..c9c3d77f4ce 100644 --- a/backend.native/tests/external/codegen/box/reflection/call/disallowNullValueForNotNullField.kt +++ b/backend.native/tests/external/codegen/box/reflection/call/disallowNullValueForNotNullField.kt @@ -4,6 +4,7 @@ // WITH_REFLECT import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.reflect.jvm.* class A { diff --git a/backend.native/tests/external/codegen/box/reflection/call/privateProperty.kt b/backend.native/tests/external/codegen/box/reflection/call/privateProperty.kt index f53b15d43d2..a9dcc40ebfb 100644 --- a/backend.native/tests/external/codegen/box/reflection/call/privateProperty.kt +++ b/backend.native/tests/external/codegen/box/reflection/call/privateProperty.kt @@ -4,6 +4,7 @@ // WITH_REFLECT import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.reflect.jvm.* import kotlin.test.* diff --git a/backend.native/tests/external/codegen/box/reflection/call/propertyAccessors.kt b/backend.native/tests/external/codegen/box/reflection/call/propertyAccessors.kt index 3fd5a3d25e0..c52ee4617e8 100644 --- a/backend.native/tests/external/codegen/box/reflection/call/propertyAccessors.kt +++ b/backend.native/tests/external/codegen/box/reflection/call/propertyAccessors.kt @@ -4,6 +4,7 @@ // WITH_REFLECT import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.test.assertEquals val p0 = 1 diff --git a/backend.native/tests/external/codegen/box/reflection/call/protectedMembers.kt b/backend.native/tests/external/codegen/box/reflection/call/protectedMembers.kt new file mode 100644 index 00000000000..ab438543565 --- /dev/null +++ b/backend.native/tests/external/codegen/box/reflection/call/protectedMembers.kt @@ -0,0 +1,35 @@ +// IGNORE_BACKEND: JS, NATIVE +// WITH_REFLECT + +import kotlin.reflect.* +import kotlin.reflect.jvm.* +import kotlin.test.* + +abstract class Base { + protected val protectedVal: String + get() = "1" + + var publicVarProtectedSet: String = "" + protected set + + protected fun protectedFun(): String = "3" +} + +class Derived : Base() + +fun member(name: String): KCallable<*> = Derived::class.members.single { it.name == name }.apply { isAccessible = true } + +fun box(): String { + val a = Derived() + + assertEquals("1", member("protectedVal").call(a)) + + val publicVarProtectedSet = member("publicVarProtectedSet") as KMutableProperty1 + publicVarProtectedSet.setter.call(a, "2") + assertEquals("2", publicVarProtectedSet.getter.call(a)) + assertEquals("2", publicVarProtectedSet.call(a)) + + assertEquals("3", member("protectedFun").call(a)) + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/reflection/callBy/manyArgumentsNoneDefaultConstructor.kt b/backend.native/tests/external/codegen/box/reflection/callBy/manyArgumentsNoneDefaultConstructor.kt new file mode 100644 index 00000000000..1a99569f436 --- /dev/null +++ b/backend.native/tests/external/codegen/box/reflection/callBy/manyArgumentsNoneDefaultConstructor.kt @@ -0,0 +1,99 @@ +// IGNORE_BACKEND: JS, NATIVE +// WITH_REFLECT + +import kotlin.test.assertEquals + +// Generate: +// (1..70).map { " p${"%02d".format(it)}: Int," }.joinToString("\n") + +class A( + p01: Int, + p02: Int, + p03: Int, + p04: Int, + p05: Int, + p06: Int, + p07: Int, + p08: Int, + p09: Int, + p10: Int, + p11: Int, + p12: Int, + p13: Int, + p14: Int, + p15: Int, + p16: Int, + p17: Int, + p18: Int, + p19: Int, + p20: Int, + p21: Int, + p22: Int, + p23: Int, + p24: Int, + p25: Int, + p26: Int, + p27: Int, + p28: Int, + p29: Int, + p30: Int, + p31: Int, + p32: Int, + p33: Int, + p34: Int, + p35: Int, + p36: Int, + p37: Int, + p38: Int, + p39: Int, + p40: Int, + p41: Int, + p42: Int, + p43: Int, + p44: Int, + p45: Int, + p46: Int, + p47: Int, + p48: Int, + p49: Int, + p50: Int, + p51: Int, + p52: Int, + p53: Int, + p54: Int, + p55: Int, + p56: Int, + p57: Int, + p58: Int, + p59: Int, + p60: Int, + p61: Int, + p62: Int, + p63: Int, + p64: Int, + p65: Int, + p66: Int, + p67: Int, + p68: Int, + p69: Int, + p70: Int +) { + init { + assertEquals(1, p01) + assertEquals(41, p41) + assertEquals(42, p42) + assertEquals(43, p43) + assertEquals(70, p70) + } +} + +fun box(): String { + val f = A::class.constructors.single() + val parameters = f.parameters + + f.callBy(mapOf( + *((1..70)).map { i -> parameters[i - 1] to i }.toTypedArray() + )) + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/reflection/callBy/manyArgumentsNoneDefaultFunction.kt b/backend.native/tests/external/codegen/box/reflection/callBy/manyArgumentsNoneDefaultFunction.kt new file mode 100644 index 00000000000..e316997b26f --- /dev/null +++ b/backend.native/tests/external/codegen/box/reflection/callBy/manyArgumentsNoneDefaultFunction.kt @@ -0,0 +1,100 @@ +// IGNORE_BACKEND: JS, NATIVE +// WITH_REFLECT + +import kotlin.test.assertEquals + +// Generate: +// (1..70).map { " p${"%02d".format(it)}: Int," }.joinToString("\n") + +class A { + fun foo( + p01: Int, + p02: Int, + p03: Int, + p04: Int, + p05: Int, + p06: Int, + p07: Int, + p08: Int, + p09: Int, + p10: Int, + p11: Int, + p12: Int, + p13: Int, + p14: Int, + p15: Int, + p16: Int, + p17: Int, + p18: Int, + p19: Int, + p20: Int, + p21: Int, + p22: Int, + p23: Int, + p24: Int, + p25: Int, + p26: Int, + p27: Int, + p28: Int, + p29: Int, + p30: Int, + p31: Int, + p32: Int, + p33: Int, + p34: Int, + p35: Int, + p36: Int, + p37: Int, + p38: Int, + p39: Int, + p40: Int, + p41: Int, + p42: Int, + p43: Int, + p44: Int, + p45: Int, + p46: Int, + p47: Int, + p48: Int, + p49: Int, + p50: Int, + p51: Int, + p52: Int, + p53: Int, + p54: Int, + p55: Int, + p56: Int, + p57: Int, + p58: Int, + p59: Int, + p60: Int, + p61: Int, + p62: Int, + p63: Int, + p64: Int, + p65: Int, + p66: Int, + p67: Int, + p68: Int, + p69: Int, + p70: Int + ) { + assertEquals(1, p01) + assertEquals(41, p41) + assertEquals(42, p42) + assertEquals(43, p43) + assertEquals(70, p70) + } +} + +fun box(): String { + val f = A::class.members.single { it.name == "foo" } + val parameters = f.parameters + + f.callBy(mapOf( + parameters.first() to A(), + *((1..70)).map { i -> parameters[i] to i }.toTypedArray() + )) + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/reflection/callBy/privateMemberFunction.kt b/backend.native/tests/external/codegen/box/reflection/callBy/privateMemberFunction.kt index 5c089543230..1c9b4f4dbf1 100644 --- a/backend.native/tests/external/codegen/box/reflection/callBy/privateMemberFunction.kt +++ b/backend.native/tests/external/codegen/box/reflection/callBy/privateMemberFunction.kt @@ -3,7 +3,7 @@ // WITH_REFLECT -import kotlin.reflect.IllegalCallableAccessException +import kotlin.reflect.full.IllegalCallableAccessException import kotlin.reflect.jvm.isAccessible class A { diff --git a/backend.native/tests/external/codegen/box/reflection/classes/companionObject.kt b/backend.native/tests/external/codegen/box/reflection/classes/companionObject.kt index a3f3b46210f..b8e0c301107 100644 --- a/backend.native/tests/external/codegen/box/reflection/classes/companionObject.kt +++ b/backend.native/tests/external/codegen/box/reflection/classes/companionObject.kt @@ -3,7 +3,7 @@ // WITH_REFLECT -import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.test.* class A { diff --git a/backend.native/tests/external/codegen/box/reflection/constructors/annotationClass.kt b/backend.native/tests/external/codegen/box/reflection/constructors/annotationClass.kt index 2975eaefe18..cfbe91532cf 100644 --- a/backend.native/tests/external/codegen/box/reflection/constructors/annotationClass.kt +++ b/backend.native/tests/external/codegen/box/reflection/constructors/annotationClass.kt @@ -4,6 +4,7 @@ // WITH_REFLECT import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.test.assertEquals annotation class A1 diff --git a/backend.native/tests/external/codegen/box/reflection/constructors/primaryConstructor.kt b/backend.native/tests/external/codegen/box/reflection/constructors/primaryConstructor.kt index 2647d082f2c..53c84fd86a1 100644 --- a/backend.native/tests/external/codegen/box/reflection/constructors/primaryConstructor.kt +++ b/backend.native/tests/external/codegen/box/reflection/constructors/primaryConstructor.kt @@ -5,7 +5,7 @@ import kotlin.test.assertNull import kotlin.test.assertNotNull -import kotlin.reflect.* +import kotlin.reflect.full.* class OnlyPrimary diff --git a/backend.native/tests/external/codegen/box/reflection/createAnnotation/callByJava.kt b/backend.native/tests/external/codegen/box/reflection/createAnnotation/callByJava.kt index e1410183b37..400d9cd5253 100644 --- a/backend.native/tests/external/codegen/box/reflection/createAnnotation/callByJava.kt +++ b/backend.native/tests/external/codegen/box/reflection/createAnnotation/callByJava.kt @@ -36,7 +36,7 @@ public interface J { import J.* import kotlin.reflect.KClass -import kotlin.reflect.primaryConstructor +import kotlin.reflect.full.primaryConstructor import kotlin.test.assertEquals import kotlin.test.assertFails diff --git a/backend.native/tests/external/codegen/box/reflection/createAnnotation/callByKotlin.kt b/backend.native/tests/external/codegen/box/reflection/createAnnotation/callByKotlin.kt index 1579deb2512..aca0876ceed 100644 --- a/backend.native/tests/external/codegen/box/reflection/createAnnotation/callByKotlin.kt +++ b/backend.native/tests/external/codegen/box/reflection/createAnnotation/callByKotlin.kt @@ -4,7 +4,7 @@ // WITH_REFLECT import kotlin.reflect.KClass -import kotlin.reflect.primaryConstructor +import kotlin.reflect.full.primaryConstructor import kotlin.test.assertEquals import kotlin.test.assertFails diff --git a/backend.native/tests/external/codegen/box/reflection/createAnnotation/callJava.kt b/backend.native/tests/external/codegen/box/reflection/createAnnotation/callJava.kt index 48adf7d623c..3e3a193f0d4 100644 --- a/backend.native/tests/external/codegen/box/reflection/createAnnotation/callJava.kt +++ b/backend.native/tests/external/codegen/box/reflection/createAnnotation/callJava.kt @@ -49,7 +49,7 @@ public interface J { import J.* import kotlin.reflect.KClass -import kotlin.reflect.primaryConstructor +import kotlin.reflect.full.primaryConstructor import kotlin.test.assertEquals import kotlin.test.assertFails diff --git a/backend.native/tests/external/codegen/box/reflection/createAnnotation/callKotlin.kt b/backend.native/tests/external/codegen/box/reflection/createAnnotation/callKotlin.kt index bc61c572b05..cf79af63878 100644 --- a/backend.native/tests/external/codegen/box/reflection/createAnnotation/callKotlin.kt +++ b/backend.native/tests/external/codegen/box/reflection/createAnnotation/callKotlin.kt @@ -4,7 +4,7 @@ // WITH_REFLECT import kotlin.reflect.KClass -import kotlin.reflect.primaryConstructor +import kotlin.reflect.full.primaryConstructor import kotlin.test.assertEquals import kotlin.test.assertFails diff --git a/backend.native/tests/external/codegen/box/reflection/enclosing/lambdaInObjectDeclaration.kt b/backend.native/tests/external/codegen/box/reflection/enclosing/lambdaInObjectDeclaration.kt index de061c4090a..9025828aa11 100644 --- a/backend.native/tests/external/codegen/box/reflection/enclosing/lambdaInObjectDeclaration.kt +++ b/backend.native/tests/external/codegen/box/reflection/enclosing/lambdaInObjectDeclaration.kt @@ -14,7 +14,7 @@ fun box(): String { if (enclosingMethod != null) return "method: $enclosingMethod" val enclosingConstructor = javaClass.getEnclosingConstructor() - if (enclosingConstructor == null) return "no enclosing constructor" + if (enclosingConstructor != null) return "field should be initialized in clInit" val enclosingClass = javaClass.getEnclosingClass() if (enclosingClass?.getName() != "O") return "enclosing class: $enclosingClass" diff --git a/backend.native/tests/external/codegen/box/reflection/functions/declaredVsInheritedFunctions.kt b/backend.native/tests/external/codegen/box/reflection/functions/declaredVsInheritedFunctions.kt index ffac5fb4245..4cb47e16f94 100644 --- a/backend.native/tests/external/codegen/box/reflection/functions/declaredVsInheritedFunctions.kt +++ b/backend.native/tests/external/codegen/box/reflection/functions/declaredVsInheritedFunctions.kt @@ -14,6 +14,7 @@ public class J { // FILE: K.kt import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.test.assertEquals open class K : J() { diff --git a/backend.native/tests/external/codegen/box/reflection/functions/javaClassGetFunctions.kt b/backend.native/tests/external/codegen/box/reflection/functions/javaClassGetFunctions.kt index c4ab712c90f..497c5199848 100644 --- a/backend.native/tests/external/codegen/box/reflection/functions/javaClassGetFunctions.kt +++ b/backend.native/tests/external/codegen/box/reflection/functions/javaClassGetFunctions.kt @@ -17,7 +17,7 @@ public class J { // FILE: K.kt -import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.test.assertEquals fun box(): String { diff --git a/backend.native/tests/external/codegen/box/reflection/functions/privateMemberFunction.kt b/backend.native/tests/external/codegen/box/reflection/functions/privateMemberFunction.kt index dd5f92d8869..4d168f76788 100644 --- a/backend.native/tests/external/codegen/box/reflection/functions/privateMemberFunction.kt +++ b/backend.native/tests/external/codegen/box/reflection/functions/privateMemberFunction.kt @@ -3,7 +3,8 @@ // WITH_REFLECT -import kotlin.reflect.* +import kotlin.reflect.KFunction +import kotlin.reflect.full.* import kotlin.reflect.jvm.* import kotlin.test.assertEquals diff --git a/backend.native/tests/external/codegen/box/reflection/functions/simpleGetFunctions.kt b/backend.native/tests/external/codegen/box/reflection/functions/simpleGetFunctions.kt index 944ad192e54..2d510742ebf 100644 --- a/backend.native/tests/external/codegen/box/reflection/functions/simpleGetFunctions.kt +++ b/backend.native/tests/external/codegen/box/reflection/functions/simpleGetFunctions.kt @@ -3,7 +3,7 @@ // WITH_REFLECT -import kotlin.reflect.* +import kotlin.reflect.full.* open class A { fun mem() {} diff --git a/backend.native/tests/external/codegen/box/reflection/mapping/fakeOverrides/javaFieldGetterSetter.kt b/backend.native/tests/external/codegen/box/reflection/mapping/fakeOverrides/javaFieldGetterSetter.kt index 77067c44a87..fb8a7c19a2f 100644 --- a/backend.native/tests/external/codegen/box/reflection/mapping/fakeOverrides/javaFieldGetterSetter.kt +++ b/backend.native/tests/external/codegen/box/reflection/mapping/fakeOverrides/javaFieldGetterSetter.kt @@ -5,6 +5,7 @@ // KT-8131 Cannot find backing field in ancestor class via reflection import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.reflect.jvm.* open class TestBase { diff --git a/backend.native/tests/external/codegen/box/reflection/mapping/fakeOverrides/javaMethod.kt b/backend.native/tests/external/codegen/box/reflection/mapping/fakeOverrides/javaMethod.kt index 04a4aab055f..53306eb488e 100644 --- a/backend.native/tests/external/codegen/box/reflection/mapping/fakeOverrides/javaMethod.kt +++ b/backend.native/tests/external/codegen/box/reflection/mapping/fakeOverrides/javaMethod.kt @@ -3,7 +3,7 @@ // WITH_REFLECT -import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.reflect.jvm.* open class TestBase { diff --git a/backend.native/tests/external/codegen/box/reflection/mapping/inlineReifiedFun.kt b/backend.native/tests/external/codegen/box/reflection/mapping/inlineReifiedFun.kt index 09060b1be71..656fbbd97d0 100644 --- a/backend.native/tests/external/codegen/box/reflection/mapping/inlineReifiedFun.kt +++ b/backend.native/tests/external/codegen/box/reflection/mapping/inlineReifiedFun.kt @@ -14,10 +14,10 @@ class Foo { } fun box(): String { - assertEquals(::g, ::g.javaMethod!!.kotlinFunction) + assertEquals(::g as Any?, ::g.javaMethod!!.kotlinFunction) val h = Foo::class.members.single { it.name == "h" } as KFunction<*> - assertEquals(h, h.javaMethod!!.kotlinFunction) + assertEquals(h, h.javaMethod!!.kotlinFunction as Any?) return "OK" } diff --git a/backend.native/tests/external/codegen/box/reflection/mapping/openSuspendFun.kt b/backend.native/tests/external/codegen/box/reflection/mapping/openSuspendFun.kt new file mode 100644 index 00000000000..1cdf1b68181 --- /dev/null +++ b/backend.native/tests/external/codegen/box/reflection/mapping/openSuspendFun.kt @@ -0,0 +1,22 @@ +// WITH_REFLECT +// IGNORE_BACKEND: JS, NATIVE + +import kotlin.reflect.full.declaredMemberFunctions +import kotlin.reflect.jvm.javaMethod +import kotlin.test.assertEquals + +open class Aaa { + suspend open fun aaa() {} +} + +class Bbb { + suspend fun bbb() {} +} + +fun box(): String { + val bbb = Bbb::class.declaredMemberFunctions.first { it.name == "bbb" }.javaMethod + assertEquals("bbb", bbb!!.name) + val aaa = Aaa::class.declaredMemberFunctions.first { it.name == "aaa" }.javaMethod + assertEquals("aaa", aaa!!.name) + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/reflection/methodsFromAny/memberExtensionToString.kt b/backend.native/tests/external/codegen/box/reflection/methodsFromAny/memberExtensionToString.kt index 1fe66891efa..81059aecea8 100644 --- a/backend.native/tests/external/codegen/box/reflection/methodsFromAny/memberExtensionToString.kt +++ b/backend.native/tests/external/codegen/box/reflection/methodsFromAny/memberExtensionToString.kt @@ -3,7 +3,7 @@ // WITH_REFLECT -import kotlin.reflect.* +import kotlin.reflect.full.* class A { var String.id: String @@ -14,10 +14,10 @@ class A { } fun box(): String { - val p = A::class.java.kotlin.memberExtensionProperties.single() + val p = A::class.memberExtensionProperties.single() return if ("$p" == "var A.(kotlin.String.)id: kotlin.String") "OK" else "Fail $p" - val q = A::class.java.kotlin.declaredFunctions.single() + val q = A::class.declaredFunctions.single() if ("$q" != "fun A.(kotlin.Int.)foo(): kotlin.Double") return "Fail q $q" return "OK" diff --git a/backend.native/tests/external/codegen/box/reflection/noReflectAtRuntime/methodsFromAny/callableReferences.kt b/backend.native/tests/external/codegen/box/reflection/noReflectAtRuntime/methodsFromAny/callableReferences.kt index 48031e6a259..9be0af350e1 100644 --- a/backend.native/tests/external/codegen/box/reflection/noReflectAtRuntime/methodsFromAny/callableReferences.kt +++ b/backend.native/tests/external/codegen/box/reflection/noReflectAtRuntime/methodsFromAny/callableReferences.kt @@ -14,7 +14,7 @@ class M { fun topLevelFun() {} val topLevelProp = "" -fun checkEquals(x: KCallable<*>, y: KCallable<*>) { +fun checkEquals(x: KCallable, y: KCallable) { assertEquals(x, y) assertEquals(y, x) assertEquals(x.hashCode(), y.hashCode()) diff --git a/backend.native/tests/external/codegen/box/reflection/noReflectAtRuntime/methodsFromAny/delegatedProperty.kt b/backend.native/tests/external/codegen/box/reflection/noReflectAtRuntime/methodsFromAny/delegatedProperty.kt index aba2096391e..be7e3c9195b 100644 --- a/backend.native/tests/external/codegen/box/reflection/noReflectAtRuntime/methodsFromAny/delegatedProperty.kt +++ b/backend.native/tests/external/codegen/box/reflection/noReflectAtRuntime/methodsFromAny/delegatedProperty.kt @@ -13,8 +13,8 @@ object Delegate { } operator fun getValue(x: Any?, p: KProperty<*>) { - assertEquals(prop, p) - assertEquals(p, prop) + assertEquals(prop as Any, p) + assertEquals(p as Any, prop) assertEquals(p.hashCode(), prop.hashCode()) assertEquals("property x (Kotlin reflection is not available)", p.toString()) } diff --git a/backend.native/tests/external/codegen/box/reflection/parameters/functionParameterNameAndIndex.kt b/backend.native/tests/external/codegen/box/reflection/parameters/functionParameterNameAndIndex.kt index 3e1e388b3ee..c19a768bd6a 100644 --- a/backend.native/tests/external/codegen/box/reflection/parameters/functionParameterNameAndIndex.kt +++ b/backend.native/tests/external/codegen/box/reflection/parameters/functionParameterNameAndIndex.kt @@ -4,6 +4,7 @@ // WITH_REFLECT import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.test.assertEquals fun foo(bar: String): Int = bar.length diff --git a/backend.native/tests/external/codegen/box/reflection/parameters/isMarkedNullable.kt b/backend.native/tests/external/codegen/box/reflection/parameters/isMarkedNullable.kt index 710974e28b1..a9b3abe131e 100644 --- a/backend.native/tests/external/codegen/box/reflection/parameters/isMarkedNullable.kt +++ b/backend.native/tests/external/codegen/box/reflection/parameters/isMarkedNullable.kt @@ -3,7 +3,7 @@ // WITH_REFLECT -import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.test.assertEquals import kotlin.test.assertTrue diff --git a/backend.native/tests/external/codegen/box/reflection/parameters/kinds.kt b/backend.native/tests/external/codegen/box/reflection/parameters/kinds.kt index 9e8281631ce..59170b332d7 100644 --- a/backend.native/tests/external/codegen/box/reflection/parameters/kinds.kt +++ b/backend.native/tests/external/codegen/box/reflection/parameters/kinds.kt @@ -3,7 +3,7 @@ // WITH_REFLECT -import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.reflect.KParameter.Kind.* import kotlin.test.assertEquals diff --git a/backend.native/tests/external/codegen/box/reflection/properties/accessors/accessorNames.kt b/backend.native/tests/external/codegen/box/reflection/properties/accessors/accessorNames.kt index 9750f307a4f..a8c61831838 100644 --- a/backend.native/tests/external/codegen/box/reflection/properties/accessors/accessorNames.kt +++ b/backend.native/tests/external/codegen/box/reflection/properties/accessors/accessorNames.kt @@ -4,6 +4,7 @@ // WITH_REFLECT import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.test.assertEquals var foo = "" diff --git a/backend.native/tests/external/codegen/box/reflection/properties/accessors/memberExtensions.kt b/backend.native/tests/external/codegen/box/reflection/properties/accessors/memberExtensions.kt index afcf1c0eb57..26235ff59bc 100644 --- a/backend.native/tests/external/codegen/box/reflection/properties/accessors/memberExtensions.kt +++ b/backend.native/tests/external/codegen/box/reflection/properties/accessors/memberExtensions.kt @@ -4,6 +4,7 @@ // WITH_REFLECT import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.test.assertEquals class C(var state: String) { diff --git a/backend.native/tests/external/codegen/box/reflection/properties/allVsDeclared.kt b/backend.native/tests/external/codegen/box/reflection/properties/allVsDeclared.kt index 58970f582d8..fe3f7c2442f 100644 --- a/backend.native/tests/external/codegen/box/reflection/properties/allVsDeclared.kt +++ b/backend.native/tests/external/codegen/box/reflection/properties/allVsDeclared.kt @@ -3,7 +3,7 @@ // WITH_REFLECT -import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.test.* open class Super { diff --git a/backend.native/tests/external/codegen/box/reflection/properties/callPrivatePropertyFromGetProperties.kt b/backend.native/tests/external/codegen/box/reflection/properties/callPrivatePropertyFromGetProperties.kt index 0006b5c4efe..2d29ba6c514 100644 --- a/backend.native/tests/external/codegen/box/reflection/properties/callPrivatePropertyFromGetProperties.kt +++ b/backend.native/tests/external/codegen/box/reflection/properties/callPrivatePropertyFromGetProperties.kt @@ -3,13 +3,14 @@ // WITH_REFLECT -import kotlin.reflect.* +import kotlin.reflect.KProperty1 +import kotlin.reflect.full.* import kotlin.reflect.jvm.* class K(private val value: String) fun box(): String { - val p = K::class.java.kotlin.memberProperties.single() as KProperty1 + val p = K::class.memberProperties.single() as KProperty1 try { return p.get(K("Fail: private property should not be accessible by default")) diff --git a/backend.native/tests/external/codegen/box/reflection/properties/declaredVsInheritedProperties.kt b/backend.native/tests/external/codegen/box/reflection/properties/declaredVsInheritedProperties.kt index 53e5eaf3aca..405ead5b7b4 100644 --- a/backend.native/tests/external/codegen/box/reflection/properties/declaredVsInheritedProperties.kt +++ b/backend.native/tests/external/codegen/box/reflection/properties/declaredVsInheritedProperties.kt @@ -14,6 +14,7 @@ public class J { // FILE: K.kt import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.test.assertEquals open class K : J() { diff --git a/backend.native/tests/external/codegen/box/reflection/properties/fakeOverridesInSubclass.kt b/backend.native/tests/external/codegen/box/reflection/properties/fakeOverridesInSubclass.kt index abeae583ff4..d0cd41df918 100644 --- a/backend.native/tests/external/codegen/box/reflection/properties/fakeOverridesInSubclass.kt +++ b/backend.native/tests/external/codegen/box/reflection/properties/fakeOverridesInSubclass.kt @@ -3,7 +3,7 @@ // WITH_REFLECT -import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.test.* open class Super(val r: String) @@ -11,10 +11,10 @@ open class Super(val r: String) class Sub(r: String) : Super(r) fun box(): String { - val props = Sub::class.java.kotlin.declaredMemberProperties + val props = Sub::class.declaredMemberProperties if (!props.isEmpty()) return "Fail $props" - val allProps = Sub::class.java.kotlin.memberProperties + val allProps = Sub::class.memberProperties assertEquals(listOf("r"), allProps.map { it.name }) return allProps.single().get(Sub("OK")) as String } diff --git a/backend.native/tests/external/codegen/box/reflection/properties/genericClassLiteralPropertyReceiverIsStar.kt b/backend.native/tests/external/codegen/box/reflection/properties/genericClassLiteralPropertyReceiverIsStar.kt index c662235809e..bfaa19b355c 100644 --- a/backend.native/tests/external/codegen/box/reflection/properties/genericClassLiteralPropertyReceiverIsStar.kt +++ b/backend.native/tests/external/codegen/box/reflection/properties/genericClassLiteralPropertyReceiverIsStar.kt @@ -4,6 +4,7 @@ // WITH_REFLECT import kotlin.reflect.* +import kotlin.reflect.full.* class A { val result = "OK" diff --git a/backend.native/tests/external/codegen/box/reflection/properties/getExtensionPropertiesMutableVsReadonly.kt b/backend.native/tests/external/codegen/box/reflection/properties/getExtensionPropertiesMutableVsReadonly.kt index 13b0c3fbec9..4a78cc3fd18 100644 --- a/backend.native/tests/external/codegen/box/reflection/properties/getExtensionPropertiesMutableVsReadonly.kt +++ b/backend.native/tests/external/codegen/box/reflection/properties/getExtensionPropertiesMutableVsReadonly.kt @@ -4,6 +4,7 @@ // WITH_REFLECT import kotlin.reflect.* +import kotlin.reflect.full.* var storage = "before" @@ -17,7 +18,7 @@ class A { } fun box(): String { - val props = A::class.java.kotlin.memberExtensionProperties + val props = A::class.memberExtensionProperties val readonly = props.single { it.name == "readonly" } assert(readonly !is KMutableProperty2) { "Fail 1: $readonly" } val mutable = props.single { it.name == "mutable" } diff --git a/backend.native/tests/external/codegen/box/reflection/properties/getPropertiesMutableVsReadonly.kt b/backend.native/tests/external/codegen/box/reflection/properties/getPropertiesMutableVsReadonly.kt index 736d0a33b91..dfb4ee51291 100644 --- a/backend.native/tests/external/codegen/box/reflection/properties/getPropertiesMutableVsReadonly.kt +++ b/backend.native/tests/external/codegen/box/reflection/properties/getPropertiesMutableVsReadonly.kt @@ -4,13 +4,14 @@ // WITH_REFLECT import kotlin.reflect.* +import kotlin.reflect.full.* class A(val readonly: String) { var mutable: String = "before" } fun box(): String { - val props = A::class.java.kotlin.memberProperties + val props = A::class.memberProperties val readonly = props.single { it.name == "readonly" } assert(readonly !is KMutableProperty1) { "Fail 1: $readonly" } val mutable = props.single { it.name == "mutable" } diff --git a/backend.native/tests/external/codegen/box/reflection/properties/invokeKProperty.kt b/backend.native/tests/external/codegen/box/reflection/properties/invokeKProperty.kt index 4b1709d8116..d762d7172b0 100644 --- a/backend.native/tests/external/codegen/box/reflection/properties/invokeKProperty.kt +++ b/backend.native/tests/external/codegen/box/reflection/properties/invokeKProperty.kt @@ -3,7 +3,7 @@ // WITH_REFLECT -import kotlin.reflect.declaredMemberProperties +import kotlin.reflect.full.declaredMemberProperties class A(val foo: String) diff --git a/backend.native/tests/external/codegen/box/reflection/properties/kotlinPropertyInheritedInJava.kt b/backend.native/tests/external/codegen/box/reflection/properties/kotlinPropertyInheritedInJava.kt index 20166493f5a..a3f9ae40aca 100644 --- a/backend.native/tests/external/codegen/box/reflection/properties/kotlinPropertyInheritedInJava.kt +++ b/backend.native/tests/external/codegen/box/reflection/properties/kotlinPropertyInheritedInJava.kt @@ -10,6 +10,7 @@ public class J extends K { // FILE: K.kt import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.reflect.jvm.* public open class K { @@ -32,7 +33,7 @@ fun box(): String { if (prop == K::prop) return "Fail J::prop == K::prop (these are different properties)" - val klass = J::class.java.kotlin + val klass = J::class if (klass.declaredMemberProperties.isNotEmpty()) return "Fail: declaredMemberProperties should be empty" if (klass.declaredMemberExtensionProperties.isNotEmpty()) return "Fail: declaredMemberExtensionProperties should be empty" diff --git a/backend.native/tests/external/codegen/box/reflection/properties/localDelegated/defaultImpls.kt b/backend.native/tests/external/codegen/box/reflection/properties/localDelegated/defaultImpls.kt new file mode 100644 index 00000000000..421e7402f1b --- /dev/null +++ b/backend.native/tests/external/codegen/box/reflection/properties/localDelegated/defaultImpls.kt @@ -0,0 +1,23 @@ +// TARGET_BACKEND: JVM +// WITH_REFLECT + +import kotlin.reflect.KProperty +import kotlin.test.assertEquals + +object Delegate { + operator fun getValue(z: Any?, p: KProperty<*>): String? { + assertEquals("val x: kotlin.String?", p.toString()) + return "OK" + } +} + +interface Foo { + fun bar(): String { + val x by Delegate + return x!! + } +} + +object O : Foo + +fun box(): String = O.bar() diff --git a/backend.native/tests/external/codegen/box/reflection/properties/localDelegated/inlineFun.kt b/backend.native/tests/external/codegen/box/reflection/properties/localDelegated/inlineFun.kt new file mode 100644 index 00000000000..74716048087 --- /dev/null +++ b/backend.native/tests/external/codegen/box/reflection/properties/localDelegated/inlineFun.kt @@ -0,0 +1,26 @@ +// TARGET_BACKEND: JVM +// WITH_REFLECT + +import kotlin.reflect.* +import kotlin.test.assertEquals + +object Delegate { + lateinit var property: KProperty<*> + + operator fun getValue(instance: Any?, kProperty: KProperty<*>) { + property = kProperty + } +} + +class Foo { + inline fun foo() { + val x by Delegate + x + } +} + +fun box(): String { + Foo().foo() + assertEquals("val x: kotlin.Unit", Delegate.property.toString()) + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/reflection/properties/localDelegated/localDelegatedProperty.kt b/backend.native/tests/external/codegen/box/reflection/properties/localDelegated/localDelegatedProperty.kt new file mode 100644 index 00000000000..81d767b6cd8 --- /dev/null +++ b/backend.native/tests/external/codegen/box/reflection/properties/localDelegated/localDelegatedProperty.kt @@ -0,0 +1,75 @@ +// TARGET_BACKEND: JVM +// WITH_REFLECT + +import kotlin.reflect.* +import kotlin.test.* + +object Delegate { + lateinit var property: KProperty<*> + + operator fun getValue(instance: Any?, kProperty: KProperty<*>): List { + property = kProperty + return emptyList() + } + + operator fun setValue(instance: Any?, kProperty: KProperty<*>, value: List) { + throw AssertionError() + } +} + +fun check(expectedName: String, p: KProperty0<*>): String? { + assertEquals(expectedName, p.name) + assertEquals(emptyList(), p.parameters) + assertEquals(emptyList(), p.typeParameters) + assertEquals(null, p.visibility) // "local" visibility is not representable with reflection API + assertEquals("kotlin.collections.List", p.returnType.toString()) + assertTrue(p.isFinal) + assertFalse(p.isOpen) + assertFalse(p.isAbstract) + assertFalse(p.isLateinit) + assertFalse(p.isConst) + + // TODO: support getDelegate for local delegated properties + assertEquals(null, (p as KProperty0<*>).getDelegate()) + + assertEquals(emptyList(), p.getter.parameters) + assertEquals("kotlin.collections.List", p.getter.returnType.toString()) + + // TODO: support annotations + assertEquals(emptyList(), p.annotations) + + try { + p.call() + return "Fail: reflective call of a local delegated property should fail because it's not supported" + } catch (e: UnsupportedOperationException) { /* ok */ } + + if (p is KMutableProperty0<*>) { + assertEquals(listOf("kotlin.collections.List"), p.setter.parameters.map { it.type.toString() }) + assertEquals("kotlin.Unit", p.setter.returnType.toString()) + + try { + p.setter.call() + return "Fail: reflective call of a local delegated property setter should fail because it's not supported" + } catch (e: UnsupportedOperationException) { /* ok */ } + } + + return null +} + +annotation class Anno + +fun box(): String { + @Anno + val localVal by Delegate + localVal + + check("localVal", Delegate.property as KProperty0<*>)?.let { error -> return error } + + @Anno + var localVar by Delegate + localVar + + check("localVar", Delegate.property as KProperty0<*>)?.let { error -> return error } + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/reflection/properties/localDelegated/multiFileClass.kt b/backend.native/tests/external/codegen/box/reflection/properties/localDelegated/multiFileClass.kt new file mode 100644 index 00000000000..26178e76e8b --- /dev/null +++ b/backend.native/tests/external/codegen/box/reflection/properties/localDelegated/multiFileClass.kt @@ -0,0 +1,43 @@ +// TARGET_BACKEND: JVM +// WITH_REFLECT + +// FILE: 1.kt + +@file:JvmMultifileClass +@file:JvmName("Test") + +package test + +import kotlin.reflect.* + +object Delegate { + lateinit var property: KProperty<*> + + operator fun getValue(instance: Any?, kProperty: KProperty<*>): List { + property = kProperty + return emptyList() + } +} + +// FILE: 2.kt + +@file:JvmMultifileClass +@file:JvmName("Test") + +package test + +fun foo() { + val x by Delegate + x +} + +// FILE: test.kt + +import test.* +import kotlin.test.assertEquals + +fun box(): String { + foo() + assertEquals("val x: kotlin.collections.List", Delegate.property.toString()) + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/reflection/properties/localDelegated/variableOfGenericType.kt b/backend.native/tests/external/codegen/box/reflection/properties/localDelegated/variableOfGenericType.kt new file mode 100644 index 00000000000..71e0440f6eb --- /dev/null +++ b/backend.native/tests/external/codegen/box/reflection/properties/localDelegated/variableOfGenericType.kt @@ -0,0 +1,31 @@ +// TARGET_BACKEND: JVM +// WITH_REFLECT + +import kotlin.reflect.* +import kotlin.test.* + +class Delegate(val value: T) { + lateinit var property: KProperty<*> + + operator fun getValue(instance: Any?, kProperty: KProperty<*>): T { + property = kProperty + return value + } +} + +class A { + inner class B { + fun foo() { + val delegate = Delegate, Z>>(emptyMap()) + val c: Map, Z> by delegate + c + + assertEquals("kotlin.collections.Map, Z>", delegate.property.returnType.toString()) + } + } +} + +fun box(): String { + A().B().foo() + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/reflection/properties/memberAndMemberExtensionWithSameName.kt b/backend.native/tests/external/codegen/box/reflection/properties/memberAndMemberExtensionWithSameName.kt index 1078c0380f9..4f506da387f 100644 --- a/backend.native/tests/external/codegen/box/reflection/properties/memberAndMemberExtensionWithSameName.kt +++ b/backend.native/tests/external/codegen/box/reflection/properties/memberAndMemberExtensionWithSameName.kt @@ -4,6 +4,7 @@ // WITH_REFLECT import kotlin.reflect.* +import kotlin.reflect.full.* class A { val foo: String = "member" @@ -12,13 +13,13 @@ class A { fun box(): String { run { - val foo: KProperty1 = A::class.java.kotlin.memberProperties.single() + val foo: KProperty1 = A::class.memberProperties.single() assert(foo.name == "foo") { "Fail name: $foo (${foo.name})" } assert(foo.get(A()) == "member") { "Fail value: ${foo.get(A())}" } } run { - val foo: KProperty2 = A::class.java.kotlin.memberExtensionProperties.single() + val foo: KProperty2 = A::class.memberExtensionProperties.single() assert(foo.name == "foo") { "Fail name: $foo (${foo.name})" } foo as KProperty2 assert(foo.get(A(), Unit) == "extension") { "Fail value: ${foo.get(A(), Unit)}" } diff --git a/backend.native/tests/external/codegen/box/reflection/properties/privateClassVal.kt b/backend.native/tests/external/codegen/box/reflection/properties/privateClassVal.kt index 6e4e20f4f72..6fe480086ce 100644 --- a/backend.native/tests/external/codegen/box/reflection/properties/privateClassVal.kt +++ b/backend.native/tests/external/codegen/box/reflection/properties/privateClassVal.kt @@ -3,7 +3,8 @@ // WITH_REFLECT -import kotlin.reflect.* +import kotlin.reflect.KProperty1 +import kotlin.reflect.full.* import kotlin.reflect.jvm.isAccessible class Result { diff --git a/backend.native/tests/external/codegen/box/reflection/properties/privateClassVar.kt b/backend.native/tests/external/codegen/box/reflection/properties/privateClassVar.kt index be1cf290bcd..fa1dd21e8bb 100644 --- a/backend.native/tests/external/codegen/box/reflection/properties/privateClassVar.kt +++ b/backend.native/tests/external/codegen/box/reflection/properties/privateClassVar.kt @@ -3,7 +3,8 @@ // WITH_REFLECT -import kotlin.reflect.* +import kotlin.reflect.KMutableProperty1 +import kotlin.reflect.full.* import kotlin.reflect.jvm.isAccessible class A { diff --git a/backend.native/tests/external/codegen/box/reflection/properties/privateFakeOverrideFromSuperclass.kt b/backend.native/tests/external/codegen/box/reflection/properties/privateFakeOverrideFromSuperclass.kt index 0ac136eed17..c6736b0e36d 100644 --- a/backend.native/tests/external/codegen/box/reflection/properties/privateFakeOverrideFromSuperclass.kt +++ b/backend.native/tests/external/codegen/box/reflection/properties/privateFakeOverrideFromSuperclass.kt @@ -3,7 +3,7 @@ // WITH_REFLECT -import kotlin.reflect.* +import kotlin.reflect.full.* open class A(private val p: Int) class B : A(42) diff --git a/backend.native/tests/external/codegen/box/reflection/properties/privatePropertyCallIsAccessibleOnAccessors.kt b/backend.native/tests/external/codegen/box/reflection/properties/privatePropertyCallIsAccessibleOnAccessors.kt index d15f8b9e09f..cd4d9e23841 100644 --- a/backend.native/tests/external/codegen/box/reflection/properties/privatePropertyCallIsAccessibleOnAccessors.kt +++ b/backend.native/tests/external/codegen/box/reflection/properties/privatePropertyCallIsAccessibleOnAccessors.kt @@ -4,6 +4,7 @@ // WITH_REFLECT import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.reflect.jvm.* import kotlin.test.* diff --git a/backend.native/tests/external/codegen/box/reflection/properties/privateToThisAccessors.kt b/backend.native/tests/external/codegen/box/reflection/properties/privateToThisAccessors.kt index 0abecc51601..7fbe2bdbc9b 100644 --- a/backend.native/tests/external/codegen/box/reflection/properties/privateToThisAccessors.kt +++ b/backend.native/tests/external/codegen/box/reflection/properties/privateToThisAccessors.kt @@ -4,6 +4,7 @@ // WITH_REFLECT import kotlin.reflect.* +import kotlin.reflect.full.* import kotlin.reflect.jvm.* class K { diff --git a/backend.native/tests/external/codegen/box/reflection/properties/protectedClassVar.kt b/backend.native/tests/external/codegen/box/reflection/properties/protectedClassVar.kt index 7c915af12df..2e539726fb7 100644 --- a/backend.native/tests/external/codegen/box/reflection/properties/protectedClassVar.kt +++ b/backend.native/tests/external/codegen/box/reflection/properties/protectedClassVar.kt @@ -3,7 +3,8 @@ // WITH_REFLECT -import kotlin.reflect.* +import kotlin.reflect.KMutableProperty1 +import kotlin.reflect.full.* import kotlin.reflect.jvm.isAccessible class A(param: String) { diff --git a/backend.native/tests/external/codegen/box/reflection/properties/simpleGetProperties.kt b/backend.native/tests/external/codegen/box/reflection/properties/simpleGetProperties.kt index f14387359b6..223907cc3ea 100644 --- a/backend.native/tests/external/codegen/box/reflection/properties/simpleGetProperties.kt +++ b/backend.native/tests/external/codegen/box/reflection/properties/simpleGetProperties.kt @@ -3,7 +3,7 @@ // WITH_REFLECT -import kotlin.reflect.* +import kotlin.reflect.full.* class A(param: String) { val int: Int get() = 42 @@ -16,9 +16,7 @@ class A(param: String) { } fun box(): String { - val klass = A::class.java.kotlin - - val props = klass.memberProperties + val props = A::class.memberProperties val names = props.map { it.name }.sorted() assert(names == listOf("anyVar", "int", "string")) { "Fail names: $props" } diff --git a/backend.native/tests/external/codegen/box/reflection/supertypes/builtInClassSupertypes.kt b/backend.native/tests/external/codegen/box/reflection/supertypes/builtInClassSupertypes.kt index 0fe836de76b..c357f42d24e 100644 --- a/backend.native/tests/external/codegen/box/reflection/supertypes/builtInClassSupertypes.kt +++ b/backend.native/tests/external/codegen/box/reflection/supertypes/builtInClassSupertypes.kt @@ -34,7 +34,7 @@ fun box(): String { check() checkAll() - check(::comparableOfString, ::charSequence, ::serializable) + check(::comparableOfString, ::charSequence, ::serializable, ::any) checkAll(::comparableOfString, ::charSequence, ::serializable, ::any) check(::number, ::comparableOfInt, ::serializable) diff --git a/backend.native/tests/external/codegen/box/reflection/supertypes/simpleSupertypes.kt b/backend.native/tests/external/codegen/box/reflection/supertypes/simpleSupertypes.kt index c17e7ce9529..b019ab3059e 100644 --- a/backend.native/tests/external/codegen/box/reflection/supertypes/simpleSupertypes.kt +++ b/backend.native/tests/external/codegen/box/reflection/supertypes/simpleSupertypes.kt @@ -13,10 +13,15 @@ interface Interface interface Interface2 class ClassAndTwoInterfaces : Interface, Simple(), Interface2 +class ClassWithSuperInterfaceOnly : Interface + +annotation class AnnotationClass + fun any(): Any = null!! fun simple(): Simple = null!! fun interface_(): Interface = null!! fun interface2(): Interface2 = null!! +fun annotation(): Annotation = null!! fun box(): String { with(Simple::class) { @@ -48,5 +53,19 @@ fun box(): String { assertEquals(setOf(Interface::class, Simple::class, Interface2::class, Any::class), allSuperclasses.toSet()) } + with (ClassWithSuperInterfaceOnly::class) { + assertEquals(listOf(::interface_.returnType, ::any.returnType), supertypes) + assertEquals(listOf(Interface::class, Any::class), superclasses) + assertEquals(setOf(::interface_.returnType, ::any.returnType), allSupertypes.toSet()) + assertEquals(setOf(Interface::class, Any::class), allSuperclasses.toSet()) + } + + with (AnnotationClass::class) { + assertEquals(listOf(::annotation.returnType, ::any.returnType), supertypes) + assertEquals(listOf(Annotation::class, Any::class), superclasses) + assertEquals(listOf(::annotation.returnType, ::any.returnType), allSupertypes) + assertEquals(listOf(Annotation::class, Any::class), allSuperclasses) + } + return "OK" } diff --git a/backend.native/tests/external/codegen/box/regressions/approximateIntersectionType.kt b/backend.native/tests/external/codegen/box/regressions/approximateIntersectionType.kt new file mode 100644 index 00000000000..0b7b38cab3c --- /dev/null +++ b/backend.native/tests/external/codegen/box/regressions/approximateIntersectionType.kt @@ -0,0 +1,30 @@ +// WITH_RUNTIME +// IGNORE_BACKEND: JS, NATIVE + +// FILE: First.java + +import java.util.List; +import java.util.Iterator; + +public class First { + public static List from(List var0) { + return null; + } +} + +// FILE: second.kt + +fun List.listFromJava() = First.from(this) +fun List.listFromKotlin() = fromKotlin(this) + +fun fromKotlin(var0: List): List = var0 + +fun test(a: List) { + val b: List? = a.listFromJava() + val c: List = a.listFromKotlin() +} + +fun box(): String { + test(listOf(1)) + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/regressions/dontCaptureTypesWithTypeVariables.kt b/backend.native/tests/external/codegen/box/regressions/dontCaptureTypesWithTypeVariables.kt new file mode 100644 index 00000000000..f14ecd2a694 --- /dev/null +++ b/backend.native/tests/external/codegen/box/regressions/dontCaptureTypesWithTypeVariables.kt @@ -0,0 +1,14 @@ +fun test(i: Inv) { + foo(i.superclass()) +} + +fun foo(x: T) {} + +class Inv + +fun Inv.superclass(): Inv = Inv() + +fun box(): String { + test(Inv()) + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/regressions/functionLiteralAsLastExpressionInBlock.kt b/backend.native/tests/external/codegen/box/regressions/functionLiteralAsLastExpressionInBlock.kt new file mode 100644 index 00000000000..13ed03338d2 --- /dev/null +++ b/backend.native/tests/external/codegen/box/regressions/functionLiteralAsLastExpressionInBlock.kt @@ -0,0 +1,8 @@ +fun box(): String { + val p: (String) -> Boolean = if (true) { + { true } + } else { + { true } + } + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/regressions/intersectionAsLastLambda.kt b/backend.native/tests/external/codegen/box/regressions/intersectionAsLastLambda.kt new file mode 100644 index 00000000000..e0667b4f106 --- /dev/null +++ b/backend.native/tests/external/codegen/box/regressions/intersectionAsLastLambda.kt @@ -0,0 +1,23 @@ +// IGNORE_BACKEND: JS, NATIVE + +// FILE: First.java + +public class First { + public static First first(K key) { + return null; + } +} + +// FILE: second.kt + +class Inv(val key: T) + +fun lastLambda(x: T, block: (T) -> R): R = block(x) + +fun myTest(m: Inv) { + lastLambda(m) { First.first(it.key) } +} + +fun box(): String { + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/regressions/intersectionOfEqualTypes.kt b/backend.native/tests/external/codegen/box/regressions/intersectionOfEqualTypes.kt new file mode 100644 index 00000000000..220d3759335 --- /dev/null +++ b/backend.native/tests/external/codegen/box/regressions/intersectionOfEqualTypes.kt @@ -0,0 +1,18 @@ +// WITH_RUNTIME + +// FILE: test.kt + +fun foo() { + takeClass(run { + val outer: Sample? = null + if (outer != null) outer else null + }) +} + +fun takeClass(instanceClass: Sample<*>?) {} +class Sample + +fun box(): String { + foo() + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/regressions/kt18779.kt b/backend.native/tests/external/codegen/box/regressions/kt18779.kt new file mode 100644 index 00000000000..986fc495998 --- /dev/null +++ b/backend.native/tests/external/codegen/box/regressions/kt18779.kt @@ -0,0 +1,19 @@ +sealed class Result { + class Failure(val exception: Exception) : Result() + class Success(val message: String) : Result() +} + +fun box(): String { + var result: Result + try { + result = Result.Success("OK") + } + catch (e: Exception) { + result = Result.Failure(Exception()) + } + + when (result) { + is Result.Failure -> throw result.exception + is Result.Success -> return result.message + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/regressions/lambdaAsLastExpressionInLambda.kt b/backend.native/tests/external/codegen/box/regressions/lambdaAsLastExpressionInLambda.kt new file mode 100644 index 00000000000..05336badb47 --- /dev/null +++ b/backend.native/tests/external/codegen/box/regressions/lambdaAsLastExpressionInLambda.kt @@ -0,0 +1,5 @@ +val foo: ((String) -> String) = run { + { it } +} + +fun box() = foo("OK") \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/regressions/lambdaPostponeConstruction.kt b/backend.native/tests/external/codegen/box/regressions/lambdaPostponeConstruction.kt new file mode 100644 index 00000000000..8da1e337a0c --- /dev/null +++ b/backend.native/tests/external/codegen/box/regressions/lambdaPostponeConstruction.kt @@ -0,0 +1,14 @@ +class MyList + +operator fun MyList.plusAssign(element: T) {} + +val listOfFunctions = MyList<(Int) -> Int>() + +fun foo() { + listOfFunctions.plusAssign({ it -> it }) + listOfFunctions += { it -> it } +} + +fun box(): String { + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/regressions/lambdaWrongReturnType.kt b/backend.native/tests/external/codegen/box/regressions/lambdaWrongReturnType.kt new file mode 100644 index 00000000000..b60e314e0fb --- /dev/null +++ b/backend.native/tests/external/codegen/box/regressions/lambdaWrongReturnType.kt @@ -0,0 +1,7 @@ +fun test() = foo({ line: String -> line }) + +fun foo(x: T): T = TODO() + +fun box(): String { + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/regressions/noCapturingForTypesWithTypeVariables.kt b/backend.native/tests/external/codegen/box/regressions/noCapturingForTypesWithTypeVariables.kt new file mode 100644 index 00000000000..993d8ad63cd --- /dev/null +++ b/backend.native/tests/external/codegen/box/regressions/noCapturingForTypesWithTypeVariables.kt @@ -0,0 +1,10 @@ +fun foo(useScriptArgs: Array?) { + val constructorArgs: Array = arrayOf(useScriptArgs.orEmpty()) +} + +inline fun Array?.orEmpty(): Array = this ?: emptyArray() + +fun box(): String { + foo(arrayOf(1)) + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/regressions/noResolutionRecursion.kt b/backend.native/tests/external/codegen/box/regressions/noResolutionRecursion.kt new file mode 100644 index 00000000000..098e9879f99 --- /dev/null +++ b/backend.native/tests/external/codegen/box/regressions/noResolutionRecursion.kt @@ -0,0 +1,5 @@ +fun T.at(element: Int) = this.at() + +fun T.at(): T = this + +fun box(): String = "OK".at() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/regressions/nullabilityForCommonCapturedSupertypes.kt b/backend.native/tests/external/codegen/box/regressions/nullabilityForCommonCapturedSupertypes.kt new file mode 100644 index 00000000000..336e9fa73a7 --- /dev/null +++ b/backend.native/tests/external/codegen/box/regressions/nullabilityForCommonCapturedSupertypes.kt @@ -0,0 +1,14 @@ +val targetArgument = id2(star(), star()) // error + +fun id2(x: T, y: T): T = x + +fun star(): Sample<*> { + return Sample() +} + +class Sample + +fun box(): String { + targetArgument + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/regressions/nullableAfterExclExcl.kt b/backend.native/tests/external/codegen/box/regressions/nullableAfterExclExcl.kt new file mode 100644 index 00000000000..781ff87ee01 --- /dev/null +++ b/backend.native/tests/external/codegen/box/regressions/nullableAfterExclExcl.kt @@ -0,0 +1,13 @@ +interface Sample { + val callMe: Int +} + +class Caller(val member: M) { + fun test() { + member!!.callMe + } +} + +fun box(): String { + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/regressions/objectInsideDelegation.kt b/backend.native/tests/external/codegen/box/regressions/objectInsideDelegation.kt new file mode 100644 index 00000000000..f2f9caf960d --- /dev/null +++ b/backend.native/tests/external/codegen/box/regressions/objectInsideDelegation.kt @@ -0,0 +1,23 @@ +// WITH_RUNTIME + +val b: First by lazy { + object : First { } +} + +private val withoutType by lazy { + object : First { } +} + +private val withTwoSupertypes by lazy { + object : First, Second { } +} + +interface First +interface Second + +fun box(): String { + b + withoutType + withTwoSupertypes + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/regressions/resolvedCallForGetOperator.kt b/backend.native/tests/external/codegen/box/regressions/resolvedCallForGetOperator.kt new file mode 100644 index 00000000000..8b0e9bd07b0 --- /dev/null +++ b/backend.native/tests/external/codegen/box/regressions/resolvedCallForGetOperator.kt @@ -0,0 +1,8 @@ +// WITH_RUNTIME + +val targetNameLists: Map = mapOf("1" to "OK") + +fun id(t: T) = t +fun foo(argumentName: String?): String? = id(targetNameLists[argumentName]) + +fun box() = foo("1") diff --git a/backend.native/tests/external/codegen/box/regressions/supertypeDepth.kt b/backend.native/tests/external/codegen/box/regressions/supertypeDepth.kt new file mode 100644 index 00000000000..bb74263ee89 --- /dev/null +++ b/backend.native/tests/external/codegen/box/regressions/supertypeDepth.kt @@ -0,0 +1,18 @@ +class A : FirstOwner> +class B : SecondOwner> + +interface FirstOwner> : SecondOwner +interface SecondOwner> + +interface StubElement + +interface Holder : StubElement + +fun test(a: A?, b: B) { + val c = a ?: b +} + +fun box(): String { + test(A(), B()) + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/reified/expectedTypeFromCast.kt b/backend.native/tests/external/codegen/box/reified/expectedTypeFromCast.kt new file mode 100644 index 00000000000..d77cad0dcd6 --- /dev/null +++ b/backend.native/tests/external/codegen/box/reified/expectedTypeFromCast.kt @@ -0,0 +1,19 @@ +// IGNORE_BACKEND: JS, NATIVE + +// LANGUAGE_VERSION: 1.2 +// WITH_RUNTIME +import kotlin.test.assertEquals + +inline fun foo(): T { + return T::class.java.getName() as T +} + +fun box(): String { + val fooCall = foo() as String + assertEquals("java.lang.String", fooCall) + + val safeFooCall = foo() as? String + assertEquals("java.lang.String", safeFooCall) + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/safeCall/primitiveEqSafeCall.kt b/backend.native/tests/external/codegen/box/safeCall/primitiveEqSafeCall.kt new file mode 100644 index 00000000000..6cfb10708e8 --- /dev/null +++ b/backend.native/tests/external/codegen/box/safeCall/primitiveEqSafeCall.kt @@ -0,0 +1,56 @@ +fun Long.id() = this + +fun String.drop2() = if (length >= 2) subSequence(2, length) else null + +fun String.anyLength(): Any = length + + +fun doSimple(s: String?) = 3 == s?.length + +fun doLongReceiver(x: Long) = 3L == x?.id() + +fun doChain(s: String?) = 1 == s?.drop2()?.length + +fun doIf(s: String?) = + if (1 == s?.length) "A" else "B" + +fun doCmpWithAny(s: String?) = + 3 == s?.anyLength() + +fun doIfNot(s: String?) = + if (!(1 == s?.length)) "A" else "B" + +fun doIfNotNot(s: String?) = + if (!!(1 == s?.length)) "A" else "B" + + +fun box(): String = when { + doSimple(null) -> "failed 1" + doSimple("1") -> "failed 2" + !doSimple("123") -> "failed 3" + + doLongReceiver(2L) -> "failed 4" + !doLongReceiver(3L) -> "failed 5" + + doChain(null) -> "failed 6" + doChain("1") -> "failed 7" + !doChain("123") -> "failed 7" + + doIf("1") != "A" -> "failed 8" + doIf("123") != "B" -> "failed 9" + doIf(null) != "B" -> "failed 10" + + doCmpWithAny(null) -> "failed 11" + doCmpWithAny("1") -> "failed 12" + !doCmpWithAny("123") -> "failed 13" + + doIfNot("1") != "B" -> "failed 8" + doIfNot("123") != "A" -> "failed 9" + doIfNot(null) != "A" -> "failed 10" + + doIfNotNot("1") != "A" -> "failed 8" + doIfNotNot("123") != "B" -> "failed 9" + doIfNotNot(null) != "B" -> "failed 10" + + else -> "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/safeCall/primitiveNotEqSafeCall.kt b/backend.native/tests/external/codegen/box/safeCall/primitiveNotEqSafeCall.kt new file mode 100644 index 00000000000..1485dea2135 --- /dev/null +++ b/backend.native/tests/external/codegen/box/safeCall/primitiveNotEqSafeCall.kt @@ -0,0 +1,43 @@ +fun Long.id() = this + +fun String.drop2() = if (length >= 2) subSequence(2, length) else null + +fun String.anyLength(): Any = length + + +fun doSimple(s: String?) = 3 != s?.length + +fun doLongReceiver(x: Long) = 3L != x?.id() + +fun doChain(s: String?) = 1 != s?.drop2()?.length + +fun doIf(s: String?) = + if (1 != s?.length) "A" else "B" + +fun doCmpWithAny(s: String?) = + 3 != s?.anyLength() + + +fun box(): String = when { + !doSimple(null) -> "failed 1" + !doSimple("1") -> "failed 2" + doSimple("123") -> "failed 3" + + !doLongReceiver(2L) -> "failed 4" + doLongReceiver(3L) -> "failed 5" + + !doChain(null) -> "failed 6" + !doChain("1") -> "failed 7" + doChain("123") -> "failed 7" + + doIf("1") == "A" -> "failed 8" + doIf("123") == "B" -> "failed 9" + doIf(null) == "B" -> "failed 10" + + !doCmpWithAny(null) -> "failed 11" + !doCmpWithAny("1") -> "failed 12" + doCmpWithAny("123") -> "failed 13" + + + else -> "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/safeCall/safeCallEqPrimitive.kt b/backend.native/tests/external/codegen/box/safeCall/safeCallEqPrimitive.kt new file mode 100644 index 00000000000..fe8438abca6 --- /dev/null +++ b/backend.native/tests/external/codegen/box/safeCall/safeCallEqPrimitive.kt @@ -0,0 +1,55 @@ +fun Long.id() = this + +fun String.drop2() = if (length >= 2) subSequence(2, length) else null + +fun String.anyLength(): Any = length + + +fun doSimple(s: String?) = s?.length == 3 + +fun doLongReceiver(x: Long) = x?.id() == 3L + +fun doChain(s: String?) = s?.drop2()?.length == 1 + +fun doIf(s: String?) = + if (s?.length == 1) "A" else "B" + +fun doCmpWithAny(s: String?) = + s?.anyLength() == 3 + +fun doIfNot(s: String?) = + if (!(s?.length == 1)) "A" else "B" + +fun doIfNotNot(s: String?) = + if (!!(s?.length == 1)) "A" else "B" + +fun box(): String = when { + doSimple(null) -> "failed 1" + doSimple("1") -> "failed 2" + !doSimple("123") -> "failed 3" + + doLongReceiver(2L) -> "failed 4" + !doLongReceiver(3L) -> "failed 5" + + doChain(null) -> "failed 6" + doChain("1") -> "failed 7" + !doChain("123") -> "failed 7" + + doIf("1") != "A" -> "failed 8" + doIf("123") != "B" -> "failed 9" + doIf(null) != "B" -> "failed 10" + + doCmpWithAny(null) -> "failed 11" + doCmpWithAny("1") -> "failed 12" + !doCmpWithAny("123") -> "failed 13" + + doIfNot("1") != "B" -> "failed 8" + doIfNot("123") != "A" -> "failed 9" + doIfNot(null) != "A" -> "failed 10" + + doIfNotNot("1") != "A" -> "failed 8" + doIfNotNot("123") != "B" -> "failed 9" + doIfNotNot(null) != "B" -> "failed 10" + + else -> "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/safeCall/safeCallNotEqPrimitive.kt b/backend.native/tests/external/codegen/box/safeCall/safeCallNotEqPrimitive.kt new file mode 100644 index 00000000000..8cac0043470 --- /dev/null +++ b/backend.native/tests/external/codegen/box/safeCall/safeCallNotEqPrimitive.kt @@ -0,0 +1,43 @@ +fun Long.id() = this + +fun String.drop2() = if (length >= 2) subSequence(2, length) else null + +fun String.anyLength(): Any = length + + +fun doSimple(s: String?) = s?.length != 3 + +fun doLongReceiver(x: Long) = x?.id() != 3L + +fun doChain(s: String?) = s?.drop2()?.length != 1 + +fun doIf(s: String?) = + if (s?.length != 1) "A" else "B" + +fun doCmpWithAny(s: String?) = + s?.anyLength() != 3 + + +fun box(): String = when { + !doSimple(null) -> "failed 1" + !doSimple("1") -> "failed 2" + doSimple("123") -> "failed 3" + + !doLongReceiver(2L) -> "failed 4" + doLongReceiver(3L) -> "failed 5" + + !doChain(null) -> "failed 6" + !doChain("1") -> "failed 7" + doChain("123") -> "failed 7" + + doIf("1") == "A" -> "failed 8" + doIf("123") == "B" -> "failed 9" + doIf(null) == "B" -> "failed 10" + + !doCmpWithAny(null) -> "failed 11" + !doCmpWithAny("1") -> "failed 12" + doCmpWithAny("123") -> "failed 13" + + + else -> "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/sam/constructors/kt19251.kt b/backend.native/tests/external/codegen/box/sam/constructors/kt19251.kt new file mode 100644 index 00000000000..0b23924234f --- /dev/null +++ b/backend.native/tests/external/codegen/box/sam/constructors/kt19251.kt @@ -0,0 +1,14 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FULL_JDK +// FILE: test.kt +fun box(): String { + val map = mutableMapOf() + val fn = Fun { TODO() } + return map.computeIfAbsent(fn, { "OK" }) +} + +// FILE: Fun.java +public interface Fun { + String invoke(String string); +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/sam/constructors/kt19251_child.kt b/backend.native/tests/external/codegen/box/sam/constructors/kt19251_child.kt new file mode 100644 index 00000000000..68dcd40f89a --- /dev/null +++ b/backend.native/tests/external/codegen/box/sam/constructors/kt19251_child.kt @@ -0,0 +1,17 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// FULL_JDK +// FILE: test.kt +fun box(): String { + val map = mutableMapOf() + val fn = DerivedFun { TODO() } + return map.computeIfAbsent(fn, { "OK" }) +} + +// FILE: Fun.java +public interface Fun { + String invoke(String string); +} + +// FILE: DerivedFun.java +public interface DerivedFun extends Fun {} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/secondaryConstructors/withNonLocalReturn.kt b/backend.native/tests/external/codegen/box/secondaryConstructors/withNonLocalReturn.kt index 2e56fdc0e88..0b0be6bbbac 100644 --- a/backend.native/tests/external/codegen/box/secondaryConstructors/withNonLocalReturn.kt +++ b/backend.native/tests/external/codegen/box/secondaryConstructors/withNonLocalReturn.kt @@ -1,6 +1,3 @@ -// TODO enable for JS backend too when KT-14549 will be fixed -// IGNORE_BACKEND: JS - inline fun run(block: () -> Unit) = block() class A { diff --git a/backend.native/tests/external/codegen/box/signatureAnnotations/defaultAndNamedCombination.kt b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultAndNamedCombination.kt new file mode 100644 index 00000000000..9bdbda176b6 --- /dev/null +++ b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultAndNamedCombination.kt @@ -0,0 +1,37 @@ +// TARGET_BACKEND: JVM + +// FILE: A.java +// ANDROID_ANNOTATIONS + +import kotlin.annotations.jvm.internal.*; + +class A { + public int first( + @ParameterName("first") @DefaultValue("42") int a, + @ParameterName("second") @DefaultValue("1") int b + ) { + return 100 * a + b; + } +} + +// FILE: main.kt +fun box(): String { + val a = A() + if (a.first() != 100 * 42 + 1) { + return "FAIL 1" + } + + if (a.first(second = 2) != 100 * 42 + 2) { + return "FAIL 2" + } + + if (a.first(first = 2) != 100 * 2 + 1) { + return "FAIL 3" + } + + if (a.first(second = 2, first = 5) != 100 * 5 + 2) { + return "FAIL 4" + } + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/signatureAnnotations/defaultBoxTypes.kt b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultBoxTypes.kt new file mode 100644 index 00000000000..2ea84d948b3 --- /dev/null +++ b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultBoxTypes.kt @@ -0,0 +1,80 @@ +// TARGET_BACKEND: JVM + +// FILE: A.java +// ANDROID_ANNOTATIONS + +import kotlin.annotations.jvm.internal.*; + +public class A { + + public Integer a(@DefaultValue("42") Integer arg) { + return arg; + } + + public Float b(@DefaultValue("42.5") Float arg) { + return arg; + } + + public Boolean c(@DefaultValue("true") Boolean arg) { + return arg; + } + + public Byte d(@DefaultValue("42") Byte arg) { + return arg; + } + + public Character e(@DefaultValue("o") Character arg) { + return arg; + } + + public Double f(@DefaultValue("1e12") Double arg) { + return arg; + } + + public Long g(@DefaultValue("42424242424242") Long arg) { + return arg; + } + + public Short h(@DefaultValue("123") Short arg) { + return arg; + } +} + +// FILE: test.kt +fun box(): String { + val a = A() + + if (a.a() != 42) { + return "FAIL Int: ${a.a()}" + } + + if (a.b() != 42.5f) { + return "FAIL Float: ${a.b()}" + } + + if (!a.c()) { + return "FAIL Boolean: ${a.c()}" + } + + if (a.d() != 42.toByte()) { + return "FAIL Byte: ${a.d()}" + } + + if (a.e() != 'o') { + return "FAIL Char: ${a.e()}" + } + + if (a.f() != 1e12) { + return "FAIl Double: ${a.f()}" + } + + if (a.g() != 42424242424242) { + return "FAIL Long: ${a.g()}" + } + + if (a.h() != 123.toShort()) { + return "FAIL Short: ${a.h()}" + } + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/signatureAnnotations/defaultEnumType.kt b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultEnumType.kt new file mode 100644 index 00000000000..695e3fef0d5 --- /dev/null +++ b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultEnumType.kt @@ -0,0 +1,42 @@ +// TARGET_BACKEND: JVM + +// FILE: Signs.java +// ANDROID_ANNOTATIONS + +public enum Signs { + HELLO, + WORLD; +} + +// FILE: B.kt +enum class B { + X, + Y; +} + +// FILE: A.java +import kotlin.annotations.jvm.internal.*; + +class A { + public Signs a(@DefaultValue("HELLO") Signs arg) { + return arg; + } + + public B b(@DefaultValue("Y") B arg) { + return arg; + } +} + +// FILE: test.kt +fun box(): String { + val a = A() + if (a.a() != Signs.HELLO) { + return "FAIL: enums Java" + } + + if (a.b() != B.Y) { + return "FAIL: enums Kotlin" + } + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/signatureAnnotations/defaultLongLiteral.kt b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultLongLiteral.kt new file mode 100644 index 00000000000..7a7e1c7cf1e --- /dev/null +++ b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultLongLiteral.kt @@ -0,0 +1,48 @@ +// TARGET_BACKEND: JVM + +// FILE: A.java +// ANDROID_ANNOTATIONS + +import kotlin.annotations.jvm.internal.*; + +public class A { + public Long first(@DefaultValue("0x1F") Long value) { + return value; + } + + public Long second(@DefaultValue("0X1F") Long value) { + return value; + } + + public Long third(@DefaultValue("0b1010") Long value) { + return value; + } + + public Long fourth(@DefaultValue("0B1010") Long value) { + return value; + } +} + +// FILE: test.kt +fun box(): String { + val a = A() + + if (a.first() != 0x1F.toLong()) { + return "FAIL 1" + } + + if (a.second() != 0x1F.toLong()) { + return "FAIL 2" + } + + if (a.third() != 0b1010.toLong()) { + return "FAIL 3" + } + + if (a.fourth() != 0b1010.toLong()) { + return "FAIL 4" + } + + return "OK" +} + diff --git a/backend.native/tests/external/codegen/box/signatureAnnotations/defaultMultipleParams.kt b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultMultipleParams.kt new file mode 100644 index 00000000000..2fedface3f7 --- /dev/null +++ b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultMultipleParams.kt @@ -0,0 +1,43 @@ +// TARGET_BACKEND: JVM + +// FILE: A.java +// ANDROID_ANNOTATIONS + +import kotlin.annotations.jvm.internal.*; + +class A { + public int first(@DefaultValue("1") int a, @DefaultValue("2") int b) { + return 100 * a + b; + } + + public int second(int a, @DefaultValue("42") int b) { + return 100 * a + b; + } +} + +// FILE: main.kt +fun box(): String { + val a = A() + + if (a.first() != 102) { + return "FAIL 1" + } + + if (a.first(2) != 202) { + return "FAIL 2" + } + + if (a.first(3, 4) != 304) { + return "FAIL 3" + } + + if (a.second(7, 8) != 708) { + return "FAIL 4" + } + + if (a.second(1) != 142) { + return "FAIL 5" + } + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/signatureAnnotations/defaultNull.kt b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultNull.kt new file mode 100644 index 00000000000..428539d56fa --- /dev/null +++ b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultNull.kt @@ -0,0 +1,56 @@ +// TARGET_BACKEND: JVM + +// FILE: A.java +// ANDROID_ANNOTATIONS + +import kotlin.annotations.jvm.internal.*; + +public class A { + public Integer foo(@DefaultNull Integer x) { return x; } + public Integer bar(@DefaultNull Integer x) { return x; } + + public Integer baz(@DefaultValue("42") Integer x) { return x; } +} + +// FILE: AInt.java +import kotlin.annotations.jvm.internal.*; + +public interface AInt { + public Integer foo(@DefaultValue("42") Integer x); + public Integer bar(@DefaultNull Integer x); +} + +// FILE: B.java + +public class B extends A { + public Integer foo(Integer x) { return x; } +} + +// FILE: C.java +import kotlin.annotations.jvm.internal.*; + +public class C extends A { + public Integer foo(@DefaultValue("42") Integer x) { return x; } + + public Integer baz(@DefaultNull Integer x) { return x; } +} + +// FILE: D.java + +public class D extends A implements AInt { +} + +// FILE: test.kt +fun box(): String { + if (A().foo() != null) return "FAIL 0" + + if (B().foo() != null) return "FAIL 1" + if (B().bar() != null) return "FAIL 2" + + if (C().foo() != null) return "FAIL 3" + if (C().baz() != 42) return "FAIL 4" + + if (D().baz() != 42) return "FAIL 5" + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/signatureAnnotations/defaultNullableBoxTypes.kt b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultNullableBoxTypes.kt new file mode 100644 index 00000000000..eec37d83f6b --- /dev/null +++ b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultNullableBoxTypes.kt @@ -0,0 +1,81 @@ +// TARGET_BACKEND: JVM + +// FILE: A.java +// ANDROID_ANNOTATIONS + +import kotlin.annotations.jvm.internal.*; +import org.jetbrains.annotations.*; + +public class A { + + public Integer a(@Nullable @DefaultValue("42") Integer arg) { + return arg; + } + + public Float b(@Nullable @DefaultValue("42.5") Float arg) { + return arg; + } + + public Boolean c(@Nullable @DefaultValue("true") Boolean arg) { + return arg; + } + + public Byte d(@Nullable @DefaultValue("42") Byte arg) { + return arg; + } + + public Character e(@Nullable @DefaultValue("o") Character arg) { + return arg; + } + + public Double f(@Nullable @DefaultValue("1e12") Double arg) { + return arg; + } + + public Long g(@Nullable @DefaultValue("42424242424242") Long arg) { + return arg; + } + + public Short h(@Nullable @DefaultValue("123") Short arg) { + return arg; + } +} + +// FILE: test.kt +fun box(): String { + val a = A() + + if (a.a() != 42) { + return "FAIL Int: ${a.a()}" + } + + if (a.b() != 42.5f) { + return "FAIL Float: ${a.b()}" + } + + if (!a.c()) { + return "FAIL Boolean: ${a.c()}" + } + + if (a.d() != 42.toByte()) { + return "FAIL Byte: ${a.d()}" + } + + if (a.e() != 'o') { + return "FAIL Char: ${a.e()}" + } + + if (a.f() != 1e12) { + return "FAIl Double: ${a.f()}" + } + + if (a.g() != 42424242424242) { + return "FAIL Long: ${a.g()}" + } + + if (a.h() != 123.toShort()) { + return "FAIL Short: ${a.h()}" + } + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/signatureAnnotations/defaultOverrides.kt b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultOverrides.kt new file mode 100644 index 00000000000..27b5d18438e --- /dev/null +++ b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultOverrides.kt @@ -0,0 +1,38 @@ +// TARGET_BACKEND: JVM + +// FILE: A.java +// ANDROID_ANNOTATIONS + +import kotlin.annotations.jvm.internal.*; + +class A { + public int first(@DefaultValue("42") int a) { + return a; + } +} + +// FILE: B.java +class B extends A { + public int first(int a) { + return a; + } +} + +// FILE: test.kt +fun box(): String { + val a = A() + val b = B() + val ab: A = B() + + if (a.first() != 42) { + return "FAIL 1" + } + if (b.first() != 42) { + return "FAIL 2" + } + if (ab.first() != 42) { + return "FAIL 4" + } + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/signatureAnnotations/defaultPrimitiveTypes.kt b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultPrimitiveTypes.kt new file mode 100644 index 00000000000..1f295ce7d7f --- /dev/null +++ b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultPrimitiveTypes.kt @@ -0,0 +1,88 @@ +// TARGET_BACKEND: JVM + +// FILE: A.java +// ANDROID_ANNOTATIONS + +import kotlin.annotations.jvm.internal.*; + +public class A { + + public int a(@DefaultValue("42") int arg) { + return arg; + } + + public float b(@DefaultValue("42.5") float arg) { + return arg; + } + + public boolean c(@DefaultValue("true") boolean arg) { + return arg; + } + + public byte d(@DefaultValue("42") byte arg) { + return arg; + } + + public char e(@DefaultValue("o") char arg) { + return arg; + } + + public double f(@DefaultValue("1e12") double arg) { + return arg; + } + + public String g(@DefaultValue("hello") String arg) { + return arg; + } + + public long h(@DefaultValue("42424242424242") long arg) { + return arg; + } + + public short i(@DefaultValue("123") short arg) { + return arg; + } +} + +// FILE: test.kt +fun box(): String { + val a = A() + + if (a.a() != 42) { + return "FAIL Int: ${a.a()}" + } + + if (a.b() != 42.5f) { + return "FAIL Float: ${a.b()}" + } + + if (!a.c()) { + return "FAIL Boolean: ${a.c()}" + } + + if (a.d() != 42.toByte()) { + return "FAIL Byte: ${a.d()}" + } + + if (a.e() != 'o') { + return "FAIL Char: ${a.e()}" + } + + if (a.f() != 1e12) { + return "FAIl Double: ${a.f()}" + } + + if (a.g() != "hello") { + return "FAIL String: ${a.g()}" + } + + if (a.h() != 42424242424242) { + return "FAIL Long: ${a.h()}" + } + + if (a.i() != 123.toShort()) { + return "FAIL Short: ${a.i()}" + } + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/signatureAnnotations/defaultValueInConstructor.kt b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultValueInConstructor.kt new file mode 100644 index 00000000000..026dd9f49ce --- /dev/null +++ b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultValueInConstructor.kt @@ -0,0 +1,40 @@ +// TARGET_BACKEND: JVM + +// FILE: A.java +// ANDROID_ANNOTATIONS + +import kotlin.annotations.jvm.internal.*; + +public class A { + public String x; + public A(@DefaultValue("OK") String hello) { + x = hello; + } +} + +// FILE: test.kt + +fun box(): String { + val a = A() + + val b = object : A() { + } + + val c = object : A() { + fun hello() = x + } + + if (a.x != "OK") { + return "FAIL 1" + } + + if (b.x != "OK") { + return "FAIL 2" + } + + if (c.hello() != "OK") { + return "FAIL 3" + } + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/signatureAnnotations/defaultWithJavaBase.kt b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultWithJavaBase.kt new file mode 100644 index 00000000000..b809e2b90fa --- /dev/null +++ b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultWithJavaBase.kt @@ -0,0 +1,26 @@ +// TARGET_BACKEND: JVM + +// FILE: A.java +// ANDROID_ANNOTATIONS + +import kotlin.annotations.jvm.internal.*; + +public class A { + public int x(@DefaultValue("42") int x) { + return x; + } +} + +// FILE: B.kt +class B : A() { + override fun x(x: Int): Int = x + 1 +} + +// FILE: box.kt +fun box(): String { + if (B().x() != 43) { + return "FAIL" + } + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/signatureAnnotations/defaultWithKotlinBase.kt b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultWithKotlinBase.kt new file mode 100644 index 00000000000..e1735227023 --- /dev/null +++ b/backend.native/tests/external/codegen/box/signatureAnnotations/defaultWithKotlinBase.kt @@ -0,0 +1,23 @@ +// TARGET_BACKEND: JVM + +// FILE: A.kt +open class A { + open fun x(x: Int = foo()) = x + private fun foo() = 42 +} + +// FILE: B.java +public class B extends A { + public int x(int i) { + return i + 1; + } +} + +// FILE: box.kt +fun box(): String { + if (B().x() != 43) { + return "FAIL" + } + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/signatureAnnotations/reorderedParameterNames.kt b/backend.native/tests/external/codegen/box/signatureAnnotations/reorderedParameterNames.kt new file mode 100644 index 00000000000..6227b07240c --- /dev/null +++ b/backend.native/tests/external/codegen/box/signatureAnnotations/reorderedParameterNames.kt @@ -0,0 +1,31 @@ +// TARGET_BACKEND: JVM + +// FILE: A.java +// ANDROID_ANNOTATIONS + +import kotlin.annotations.jvm.internal.*; + +public class A { + public int connect(@ParameterName("host") int host, @ParameterName("port") int port) { + return host; + } +} + +// FILE: test.kt +fun box(): String { + val test = A() + + if (test.connect(host = 42, port = 8080) != 42) { + return "FAIL 1" + } + + if (test.connect(port = 1234, host = 5678) != 5678) { + return "FAIL 2" + } + + if (test.connect(9876, 4321) != 9876) { + return "FAIL 3" + } + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/smartCasts/kt17725.kt b/backend.native/tests/external/codegen/box/smartCasts/kt17725.kt new file mode 100644 index 00000000000..71334c4f85b --- /dev/null +++ b/backend.native/tests/external/codegen/box/smartCasts/kt17725.kt @@ -0,0 +1,10 @@ +class Bob { + fun Bob.bar() = "OK" +} + +fun Any.foo() = when(this) { + is Bob -> bar() + else -> throw AssertionError() +} + +fun box(): String = Bob().foo() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/smartCasts/kt19058.kt b/backend.native/tests/external/codegen/box/smartCasts/kt19058.kt new file mode 100644 index 00000000000..0bf2c376954 --- /dev/null +++ b/backend.native/tests/external/codegen/box/smartCasts/kt19058.kt @@ -0,0 +1,19 @@ +// TARGET_BACKEND: JVM +// FILE: Test.kt +open class KFoo { + fun foo(): String { + if (this is KFooBar) return bar + throw AssertionError() + } +} + +class KFooBar : KFoo(), JBar + +fun box(): String = KFooBar().foo() + +// FILE: JBar.java +public interface JBar { + default String getBar() { + return "OK"; + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/smartCasts/kt19100.kt b/backend.native/tests/external/codegen/box/smartCasts/kt19100.kt new file mode 100644 index 00000000000..43113a91d5e --- /dev/null +++ b/backend.native/tests/external/codegen/box/smartCasts/kt19100.kt @@ -0,0 +1,12 @@ +open class KFoo { + fun foo(): String { + if (this is KFooQux) return qux + throw AssertionError() + } +} + +class KFooQux : KFoo() + +val KFooQux.qux get() = "OK" + +fun box() = KFooQux().foo() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/specialBuiltins/removeSetInt.kt b/backend.native/tests/external/codegen/box/specialBuiltins/removeSetInt.kt new file mode 100644 index 00000000000..868c5c6bc4b --- /dev/null +++ b/backend.native/tests/external/codegen/box/specialBuiltins/removeSetInt.kt @@ -0,0 +1,18 @@ +class MySet : HashSet() { + override fun remove(element: Int): Boolean { + return super.remove(element) + } +} + +fun box(): String { + val a = MySet() + a.add(1) + a.add(2) + a.add(3) + + if (!a.remove(1)) return "fail 1" + if (a.remove(1)) return "fail 2" + if (a.contains(1)) return "fail 3" + + return "OK" +} diff --git a/backend.native/tests/external/codegen/box/strings/constInStringTemplate.kt b/backend.native/tests/external/codegen/box/strings/constInStringTemplate.kt new file mode 100644 index 00000000000..5595599889d --- /dev/null +++ b/backend.native/tests/external/codegen/box/strings/constInStringTemplate.kt @@ -0,0 +1,25 @@ +// WITH_RUNTIME + +import kotlin.test.assertEquals + +const val constTrue = true +const val const42 = 42 +const val constPiF = 3.14F +const val constPi = 3.1415926358 +const val constString = "string" + +fun box(): String { + assertEquals("true", "$constTrue") + assertEquals("42", "$const42") + assertEquals("3.14", "$constPiF") + assertEquals("3.1415926358", "$constPi") + assertEquals("string", "$constString") + + assertEquals(constPi.toString(), "$constPi") + assertEquals((constPi * constPi).toString(), "${constPi * constPi}") + + assertEquals("null", "${null}") + assertEquals("42", "${42}") + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/strings/kt894.kt b/backend.native/tests/external/codegen/box/strings/kt894.kt index d822bcd3456..e2aeb1f5bab 100644 --- a/backend.native/tests/external/codegen/box/strings/kt894.kt +++ b/backend.native/tests/external/codegen/box/strings/kt894.kt @@ -1,6 +1,3 @@ -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - fun stringConcat(n : Int) : String? { var string : String? = "" for (i in 0..(n - 1)) diff --git a/backend.native/tests/external/codegen/box/strings/nestedConcat.kt b/backend.native/tests/external/codegen/box/strings/nestedConcat.kt new file mode 100644 index 00000000000..6c27ecec29e --- /dev/null +++ b/backend.native/tests/external/codegen/box/strings/nestedConcat.kt @@ -0,0 +1,21 @@ +// WITH_RUNTIME + +import kotlin.test.assertEquals + +fun test1(s1: String, s2: String, s3: String) = + (s1 + s2) + s3 + +fun test2(s1: String, s2: String, s3: String) = + s1 + (s2 + s3) + +fun test3(s1: String, s2: String, s3: String) = + "s1: $s1; " + + "s2: $s2; " + + "s3: $s3" + +fun box(): String { + assertEquals("123", test1("1", "2", "3")) + assertEquals("123", test2("1", "2", "3")) + assertEquals("s1: 1; s2: 2; s3: 3", test3("1", "2", "3")) + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/super/superConstructor/kt17464_arrayOf.kt b/backend.native/tests/external/codegen/box/super/superConstructor/kt17464_arrayOf.kt new file mode 100644 index 00000000000..eb092f89776 --- /dev/null +++ b/backend.native/tests/external/codegen/box/super/superConstructor/kt17464_arrayOf.kt @@ -0,0 +1,5 @@ +open class A(val array: Array) + +class B : A(arrayOf("OK")) + +fun box() = B().array[0].toString() \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/super/superConstructor/kt17464_linkedMapOf.kt b/backend.native/tests/external/codegen/box/super/superConstructor/kt17464_linkedMapOf.kt new file mode 100644 index 00000000000..66a8d9a8893 --- /dev/null +++ b/backend.native/tests/external/codegen/box/super/superConstructor/kt17464_linkedMapOf.kt @@ -0,0 +1,9 @@ +// WITH_RUNTIME +// FULL_JDK + +open class B(val map: LinkedHashMap) + +class C : B(linkedMapOf("O" to "K")) + +fun box() = + C().map.entries.first().let { it.key + it.value } \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/super/superConstructor/kt18356.kt b/backend.native/tests/external/codegen/box/super/superConstructor/kt18356.kt new file mode 100644 index 00000000000..150d2f5dd85 --- /dev/null +++ b/backend.native/tests/external/codegen/box/super/superConstructor/kt18356.kt @@ -0,0 +1,8 @@ +open class Base(val addr: Long, val name: String) + +fun box(): String { + val obj1 = object : Base(name = "OK", addr = 0x1234L) {} + if (obj1.addr != 0x1234L) return "fail ${obj1.addr}" + return obj1.name +} + diff --git a/backend.native/tests/external/codegen/box/super/superConstructor/kt18356_2.kt b/backend.native/tests/external/codegen/box/super/superConstructor/kt18356_2.kt new file mode 100644 index 00000000000..9773342f5fa --- /dev/null +++ b/backend.native/tests/external/codegen/box/super/superConstructor/kt18356_2.kt @@ -0,0 +1,8 @@ +abstract class Base(val s: String, vararg ints: Int) + +fun foo(s: String, ints: IntArray) = object : Base(ints = *ints, s = s) {} + +fun box(): String { + return foo("OK", intArrayOf(1, 2)).s +} + diff --git a/backend.native/tests/external/codegen/box/super/superConstructor/objectExtendsInner.kt b/backend.native/tests/external/codegen/box/super/superConstructor/objectExtendsInner.kt new file mode 100644 index 00000000000..83d075cdeae --- /dev/null +++ b/backend.native/tests/external/codegen/box/super/superConstructor/objectExtendsInner.kt @@ -0,0 +1,14 @@ +open class Foo(val value: String) { + + open inner class Inner(val d: Double = -1.0, val s: String, vararg val y: Int) { + open fun result() = "Fail" + } + + val obj = object : Inner(s = "O") { + override fun result() = s + value + } +} + +fun box(): String { + return Foo("K").obj.result() +} diff --git a/backend.native/tests/external/codegen/box/super/superConstructor/objectExtendsLocalInner.kt b/backend.native/tests/external/codegen/box/super/superConstructor/objectExtendsLocalInner.kt new file mode 100644 index 00000000000..ab3c695f278 --- /dev/null +++ b/backend.native/tests/external/codegen/box/super/superConstructor/objectExtendsLocalInner.kt @@ -0,0 +1,17 @@ +fun box(): String { + val capture = "O" + + class Local { + val captured = capture + + open inner class Inner(val d: Double = -1.0, val s: String, vararg val y: Int) { + open fun result() = "Fail" + } + + val obj = object : Inner(s = "K") { + override fun result() = capture + s + } + } + + return Local().obj.result() +} diff --git a/backend.native/tests/external/codegen/box/syntheticAccessors/accessorForGenericConstructor.kt b/backend.native/tests/external/codegen/box/syntheticAccessors/accessorForGenericConstructor.kt new file mode 100644 index 00000000000..9a97980a5a6 --- /dev/null +++ b/backend.native/tests/external/codegen/box/syntheticAccessors/accessorForGenericConstructor.kt @@ -0,0 +1,20 @@ +fun box(): String { + A.Nested().nestedA() + A.Nested().Inner().innerA() + A.companionA() + return "OK" +} + +class A private constructor(val x: T, val y: Int = 0) { + class Nested { + fun nestedA() = A(1L) + + inner class Inner { + fun innerA() = A(1L) + } + } + + companion object { + fun companionA() = A(1L) + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/syntheticAccessors/accessorForGenericMethod.kt b/backend.native/tests/external/codegen/box/syntheticAccessors/accessorForGenericMethod.kt new file mode 100644 index 00000000000..a5ffca91336 --- /dev/null +++ b/backend.native/tests/external/codegen/box/syntheticAccessors/accessorForGenericMethod.kt @@ -0,0 +1,29 @@ +// FILE: test.kt +import b.B + +fun box() = + B().getOK() + +// FILE: a.kt +package a + +open class A { + protected fun getO(x: T) = "O" + protected fun getK(x: T) = "K" +} + +// FILE: b.kt +package b + +import a.A + +class B : A() { + inner class Inner { + fun innerGetO() = getO(0L) + } + + fun lambdaGetK() = { -> getK(0L) } + + fun getOK() = + Inner().innerGetO() + lambdaGetK().invoke() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/syntheticAccessors/accessorForGenericMethodWithDefaults.kt b/backend.native/tests/external/codegen/box/syntheticAccessors/accessorForGenericMethodWithDefaults.kt new file mode 100644 index 00000000000..943d7e681cd --- /dev/null +++ b/backend.native/tests/external/codegen/box/syntheticAccessors/accessorForGenericMethodWithDefaults.kt @@ -0,0 +1,29 @@ +// FILE: test.kt +import b.B + +fun box() = + B().getOK() + +// FILE: a.kt +package a + +open class A { + protected fun getO(x: T, z: String = "") = "O" + z + protected fun getK(x: T, z: String = "") = "K" + z +} + +// FILE: b.kt +package b + +import a.A + +class B : A() { + inner class Inner { + fun innerGetO() = getO(0L) + } + + fun lambdaGetK() = { -> getK(0L) } + + fun getOK() = + Inner().innerGetO() + lambdaGetK().invoke() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/syntheticAccessors/jvmNameForAccessors.kt b/backend.native/tests/external/codegen/box/syntheticAccessors/jvmNameForAccessors.kt new file mode 100644 index 00000000000..0a39d77e650 --- /dev/null +++ b/backend.native/tests/external/codegen/box/syntheticAccessors/jvmNameForAccessors.kt @@ -0,0 +1,15 @@ +// IGNORE_BACKEND: JS, NATIVE +// WITH_RUNTIME + + +@JvmName("fooA") +private fun String.foo(t: String?): String = this + +private fun String.foo(t: String): String = this + +fun runNoInline(fn: () -> String) = fn() + +fun box() = + runNoInline { "O".foo("") } + + runNoInline { "K".foo(null) } + diff --git a/backend.native/tests/external/codegen/box/traits/interfaceWithNonAbstractFunIndirect.kt b/backend.native/tests/external/codegen/box/traits/interfaceWithNonAbstractFunIndirect.kt new file mode 100644 index 00000000000..e77b2472214 --- /dev/null +++ b/backend.native/tests/external/codegen/box/traits/interfaceWithNonAbstractFunIndirect.kt @@ -0,0 +1,29 @@ +interface I { + fun foo(): String = "foo" + + fun bar(x: String = "default") = "bar:$x" +} + +interface J : I + +interface K : J + +class A : I, J + +class B : K, I + +fun box(): String { + val foo = A().foo() + if (foo != "foo") return "fail1: $foo" + + val bar1 = A().bar() + if (bar1 != "bar:default") return "fail2: $bar1" + + val bar2 = A().bar("q") + if (bar2 != "bar:q") return "fail3: $bar2" + + val foo2 = B().foo() + if (foo2 != "foo") return "fail4: $foo2" + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/traits/interfaceWithNonAbstractFunIndirectGeneric.kt b/backend.native/tests/external/codegen/box/traits/interfaceWithNonAbstractFunIndirectGeneric.kt new file mode 100644 index 00000000000..65f641c2d5a --- /dev/null +++ b/backend.native/tests/external/codegen/box/traits/interfaceWithNonAbstractFunIndirectGeneric.kt @@ -0,0 +1,27 @@ +interface I { + fun foo(x: T): String = "foo($x)" + + fun bar(x: T, y: String = "default") = "bar($x,$y)" +} + +interface J : I + +class A : I, J + +class B : J, I + +fun box(): String { + val foo = A().foo("q") + if (foo != "foo(q)") return "fail1: $foo" + + val bar1 = A().bar("w") + if (bar1 != "bar(w,default)") return "fail2: $bar1" + + val bar2 = A().bar("e", "r") + if (bar2 != "bar(e,r)") return "fail3: $bar2" + + val foo2 = B().foo("t") + if (foo2 != "foo(t)") return "fail4: $foo2" + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/traits/kt3500.kt b/backend.native/tests/external/codegen/box/traits/kt3500.kt index 92954f58c8d..18433df514a 100644 --- a/backend.native/tests/external/codegen/box/traits/kt3500.kt +++ b/backend.native/tests/external/codegen/box/traits/kt3500.kt @@ -1,6 +1,3 @@ -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - interface BK { fun foo(): String = 10.toString() } diff --git a/backend.native/tests/external/codegen/box/unit/UnitValue.kt b/backend.native/tests/external/codegen/box/unit/UnitValue.kt index 1fef505f0af..243b563dba8 100644 --- a/backend.native/tests/external/codegen/box/unit/UnitValue.kt +++ b/backend.native/tests/external/codegen/box/unit/UnitValue.kt @@ -1,6 +1,3 @@ -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - fun foo() {} fun box(): String { diff --git a/backend.native/tests/external/codegen/box/unit/kt4212.kt b/backend.native/tests/external/codegen/box/unit/kt4212.kt index e0c04071aca..5d9db4097e7 100644 --- a/backend.native/tests/external/codegen/box/unit/kt4212.kt +++ b/backend.native/tests/external/codegen/box/unit/kt4212.kt @@ -1,6 +1,3 @@ -// TODO: muted automatically, investigate should it be ran for JS or not -// IGNORE_BACKEND: JS - fun foo(): Any? = bar() fun bar() {} diff --git a/backend.native/tests/external/codegen/box/vararg/assigningArrayToVarargInAnnotation.kt b/backend.native/tests/external/codegen/box/vararg/assigningArrayToVarargInAnnotation.kt new file mode 100644 index 00000000000..354ab6bddbf --- /dev/null +++ b/backend.native/tests/external/codegen/box/vararg/assigningArrayToVarargInAnnotation.kt @@ -0,0 +1,68 @@ +// LANGUAGE_VERSION: 1.2 +// WITH_REFLECT + +// IGNORE_BACKEND: JS +// IGNORE_BACKEND: NATIVE + +// FILE: JavaAnn.java + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +@interface JavaAnn { + String[] value() default {}; + String[] path() default {}; +} + +// FILE: test.kt + +import java.util.Arrays +import kotlin.reflect.KClass +import kotlin.reflect.KFunction0 +import kotlin.reflect.full.findAnnotation + +inline fun test(kFunction: KFunction0, test: T.() -> Unit) { + val annotation = kFunction.findAnnotation()!! + annotation.test() +} + +fun check(b: Boolean, message: String) { + if (!b) throw RuntimeException(message) +} + +annotation class Ann(vararg val s: String) + +@Ann(s = ["value1", "value2"]) +fun test1() {} + +@Ann(s = arrayOf("value3", "value4")) +fun test2() {} + +@JavaAnn(value = ["value5"], path = ["value6"]) +fun test3() {} + +@JavaAnn("value7", path = ["value8"]) +fun test4() {} + +fun box(): String { + test(::test1) { + check(s.contentEquals(arrayOf("value1", "value2")), "Fail 1: ${s.joinToString()}") + } + + test(::test2) { + check(s.contentEquals(arrayOf("value3", "value4")), "Fail 2: ${s.joinToString()}") + } + + test(::test3) { + check(value.contentEquals(arrayOf("value5")), "Fail 3: ${value.joinToString()}") + check(path.contentEquals(arrayOf("value6")), "Fail 3: ${path.joinToString()}") + } + + test(::test4) { + check(value.contentEquals(arrayOf("value7")), "Fail 4: ${value.joinToString()}") + check(path.contentEquals(arrayOf("value8")), "Fail 4: ${path.joinToString()}") + } + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/vararg/doNotCopyImmediatelyCreatedArrays.kt b/backend.native/tests/external/codegen/box/vararg/doNotCopyImmediatelyCreatedArrays.kt new file mode 100644 index 00000000000..6cc4d47dc23 --- /dev/null +++ b/backend.native/tests/external/codegen/box/vararg/doNotCopyImmediatelyCreatedArrays.kt @@ -0,0 +1,102 @@ +fun booleanVararg(vararg xs: Boolean) { + if (xs.size != 1 && xs[0] != true) throw AssertionError() +} + +fun byteVararg(vararg xs: Byte) { + if (xs.size != 1 && xs[0] != 1.toByte()) throw AssertionError() +} + +fun shortVararg(vararg xs: Short) { + if (xs.size != 1 && xs[0] != 1.toShort()) throw AssertionError() +} + +fun intVararg(vararg xs: Int) { + if (xs.size != 1 && xs[0] != 1) throw AssertionError() +} + +fun longVararg(vararg xs: Long) { + if (xs.size != 1 && xs[0] != 1L) throw AssertionError() +} + +fun floatVararg(vararg xs: Float) { + if (xs.size != 1 && xs[0] != 1.0f) throw AssertionError() +} + +fun doubleVararg(vararg xs: Double) { + if (xs.size != 1 && xs[0] != 1.0) throw AssertionError() +} + +fun anyVararg(vararg xs: Any?) { + if (xs.size != 1 && (xs[0] != 1 && xs[0] != null)) throw AssertionError() +} + +fun genericVararg(vararg xs: T) { + if (xs.size != 1 && (xs[0] != 1 && xs[0] != null)) throw AssertionError() +} + +fun box(): String { + booleanVararg(*booleanArrayOf(true)) + booleanVararg(*BooleanArray(1)) + booleanVararg(*BooleanArray(1) { true }) + booleanVararg(xs = *booleanArrayOf(true)) + booleanVararg(xs = *BooleanArray(1)) + booleanVararg(xs = *BooleanArray(1) { true }) + + byteVararg(*byteArrayOf(1)) + byteVararg(*ByteArray(1)) + byteVararg(*ByteArray(1) { 1 }) + byteVararg(xs = *byteArrayOf(1)) + byteVararg(xs = *ByteArray(1)) + byteVararg(xs = *ByteArray(1) { 1 }) + + shortVararg(*shortArrayOf(1)) + shortVararg(*ShortArray(1)) + shortVararg(*ShortArray(1) { 1 }) + shortVararg(xs = *shortArrayOf(1)) + shortVararg(xs = *ShortArray(1)) + shortVararg(xs = *ShortArray(1) { 1 }) + + intVararg(*intArrayOf(1)) + intVararg(*IntArray(1)) + intVararg(*IntArray(1) { 1 }) + intVararg(xs = *intArrayOf(1)) + intVararg(xs = *IntArray(1)) + intVararg(xs = *IntArray(1) { 1 }) + + longVararg(*longArrayOf(1L)) + longVararg(*LongArray(1)) + longVararg(*LongArray(1) { 1L }) + longVararg(xs = *longArrayOf(1L)) + longVararg(xs = *LongArray(1)) + longVararg(xs = *LongArray(1) { 1L }) + + floatVararg(*floatArrayOf(1.0f)) + floatVararg(*FloatArray(1)) + floatVararg(*FloatArray(1) { 1.0f }) + floatVararg(xs = *floatArrayOf(1.0f)) + floatVararg(xs = *FloatArray(1)) + floatVararg(xs = *FloatArray(1) { 1.0f }) + + doubleVararg(*doubleArrayOf(1.0)) + doubleVararg(*DoubleArray(1)) + doubleVararg(*DoubleArray(1) { 1.0 }) + doubleVararg(xs = *doubleArrayOf(1.0)) + doubleVararg(xs = *DoubleArray(1)) + doubleVararg(xs = *DoubleArray(1) { 1.0 }) + + anyVararg(*arrayOf(1)) + anyVararg(*Array(1) { 1 }) + anyVararg(*arrayOfNulls(1)) + anyVararg(xs = *arrayOf(1)) + anyVararg(xs = *Array(1) { 1 }) + anyVararg(xs = *arrayOfNulls(1)) + + genericVararg(*arrayOf(1)) + genericVararg(*Array(1) { 1 }) + genericVararg(*arrayOfNulls(1)) + genericVararg(xs = *arrayOf(1)) + genericVararg(xs = *Array(1) { 1 }) + genericVararg(xs = *arrayOfNulls(1)) + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/box/when/whenSafeCallSubjectEvaluatedOnce.kt b/backend.native/tests/external/codegen/box/when/whenSafeCallSubjectEvaluatedOnce.kt new file mode 100644 index 00000000000..18ec8a99651 --- /dev/null +++ b/backend.native/tests/external/codegen/box/when/whenSafeCallSubjectEvaluatedOnce.kt @@ -0,0 +1,19 @@ +var subjectEvaluated = 0 + +fun String.foo() = length.also { ++subjectEvaluated } + +fun test(s: String?) = + when (s?.foo()) { + 0 -> "zero" + 1 -> "one" + 2 -> "two" + else -> "other" + } + +fun box(): String { + val t = test("12") + if (t != "two") return "Fail: $t" + if (subjectEvaluated != 1) return "Fail: subjectEvaluated=$subjectEvaluated" + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972.kt b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972.kt new file mode 100644 index 00000000000..42272555489 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972.kt @@ -0,0 +1,33 @@ +// FILE: 1.kt +package test + +class Test { + + val prop: String = "OK" + + fun test() = + inlineFun { + noInline { + object { + val inflater = prop + }.inflater + } + } +} + +inline fun inlineFun(init: () -> T): T { + return init() +} + +fun noInline(init: () -> T): T { + return init() +} + +// FILE: 2.kt +//NO_CHECK_LAMBDA_INLINING + +import test.* + +fun box(): String { + return Test().test() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_2.kt b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_2.kt new file mode 100644 index 00000000000..04ac09e1f8e --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_2.kt @@ -0,0 +1,33 @@ +// FILE: 1.kt +package test + +class Test { + + val prop: String = "OK" + + fun test() = + inlineFun { + inlineFun2 { + object { + val inflater = prop + }.inflater + } + } +} + +inline fun inlineFun(init: () -> T): T { + return init() +} + +inline fun inlineFun2(init: () -> T): T { + return init() +} + +// FILE: 2.kt +//NO_CHECK_LAMBDA_INLINING + +import test.* + +fun box(): String { + return Test().test() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_3.kt b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_3.kt new file mode 100644 index 00000000000..d5550708d35 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_3.kt @@ -0,0 +1,35 @@ +// FILE: 1.kt +package test + +class Test { + + val prop: String = "OK" + + fun test() = + inlineFun { + noInline { + inlineFun { + object { + val inflater = prop + }.inflater + } + } + } +} + +inline fun inlineFun(init: () -> T): T { + return init() +} + +fun noInline(init: () -> T): T { + return init() +} + +// FILE: 2.kt +//NO_CHECK_LAMBDA_INLINING + +import test.* + +fun box(): String { + return Test().test() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_4.kt b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_4.kt new file mode 100644 index 00000000000..63a24a7a48c --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_4.kt @@ -0,0 +1,37 @@ +// FILE: 1.kt +package test + +class Test { + + val prop: String = "OK" + + fun test() = + inlineFun { + noInline { + inlineFun { + noInline { + object { + val inflater = prop + }.inflater + } + } + } + } +} + +inline fun inlineFun(init: () -> T): T { + return init() +} + +fun noInline(init: () -> T): T { + return init() +} + +// FILE: 2.kt +//NO_CHECK_LAMBDA_INLINING + +import test.* + +fun box(): String { + return Test().test() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_5.kt b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_5.kt new file mode 100644 index 00000000000..e244855dd3d --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_5.kt @@ -0,0 +1,35 @@ +// FILE: 1.kt +package test + +class Test { + + val prop: String = "OK" + + fun test() = + inlineFun { + noInline { + noInline { + object { + val inflater = prop + }.inflater + } + } + } +} + +inline fun inlineFun(init: () -> T): T { + return init() +} + +fun noInline(init: () -> T): T { + return init() +} + +// FILE: 2.kt +//NO_CHECK_LAMBDA_INLINING + +import test.* + +fun box(): String { + return Test().test() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_super.kt b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_super.kt new file mode 100644 index 00000000000..81121ef7928 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_super.kt @@ -0,0 +1,35 @@ +// FILE: 1.kt +package test + +open class A(val value: String) + +class Test { + + val prop: String = "OK" + + fun test() = + inlineFun { + noInline { + object : A(prop) { + + }.value + } + } +} + +inline fun inlineFun(init: () -> T): T { + return init() +} + +fun noInline(init: () -> T): T { + return init() +} + +// FILE: 2.kt +//NO_CHECK_LAMBDA_INLINING + +import test.* + +fun box(): String { + return Test().test() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_super2.kt b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_super2.kt new file mode 100644 index 00000000000..8f07e0d611e --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_super2.kt @@ -0,0 +1,37 @@ +// FILE: 1.kt +package test + +open class A(val value: String) + +class Test { + + val prop: String = "OK" + + fun test() = + inlineFun { + noInline { + inlineFun { + object : A(prop) { + + }.value + } + } + } +} + +inline fun inlineFun(init: () -> T): T { + return init() +} + +fun noInline(init: () -> T): T { + return init() +} + +// FILE: 2.kt +//NO_CHECK_LAMBDA_INLINING + +import test.* + +fun box(): String { + return Test().test() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_super3.kt b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_super3.kt new file mode 100644 index 00000000000..2e6ec71e3f4 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt17972_super3.kt @@ -0,0 +1,39 @@ +// FILE: 1.kt +package test + +open class A(val value: String) + +class Test { + + val prop: String = "OK" + + fun test() = + inlineFun { + noInline { + inlineFun { + noInline { + object : A(prop) { + + }.value + } + } + } + } +} + +inline fun inlineFun(init: () -> T): T { + return init() +} + +fun noInline(init: () -> T): T { + return init() +} + +// FILE: 2.kt +//NO_CHECK_LAMBDA_INLINING + +import test.* + +fun box(): String { + return Test().test() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/anonymousObject/kt19434.kt b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt19434.kt new file mode 100644 index 00000000000..1ac01af5003 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt19434.kt @@ -0,0 +1,23 @@ +// FILE: 1.kt +//WITH_RUNTIME +package test + +annotation class MethodAnnotation + +inline fun reproduceIssue(crossinline s: () -> String): String { + val obj = object { + @MethodAnnotation fun annotatedMethod(): String { + return s() + } + } + val annotatedMethod = obj::class.java.declaredMethods.first { it.name == "annotatedMethod" } + if (annotatedMethod.annotations.isEmpty()) return "fail: can't find annotated method" + return obj.annotatedMethod() +} + +// FILE: 2.kt +import test.* + +fun box(): String { + return reproduceIssue { "OK" } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/anonymousObject/kt19434_2.kt b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt19434_2.kt new file mode 100644 index 00000000000..dea98563dd2 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt19434_2.kt @@ -0,0 +1,24 @@ +// FILE: 1.kt +//WITH_RUNTIME +package test + +annotation class FieldAnnotation + +inline fun reproduceIssue(crossinline s: () -> String): String { + val obj = object { + @field:FieldAnnotation val annotatedField = "O" + fun method(): String { + return annotatedField + s() + } + } + val annotatedMethod = obj::class.java.declaredFields.first { it.name == "annotatedField" } + if (annotatedMethod.annotations.isEmpty()) return "fail: can't find annotated field" + return obj.method() +} + +// FILE: 2.kt +import test.* + +fun box(): String { + return reproduceIssue { "K" } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/anonymousObject/kt19723.kt b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt19723.kt new file mode 100644 index 00000000000..b02b61375c8 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/anonymousObject/kt19723.kt @@ -0,0 +1,21 @@ +// FILE: 1.kt +package test + +inline fun String.fire(message: String? = null) { + val res = this + message!! +} + +// FILE: 2.kt +// NO_CHECK_LAMBDA_INLINING + +import test.* + +fun box(): String { + val receiver = "receiver" + "".let { + { + receiver.fire() + } + } + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/bytecodePreprocessing/apiVersionAtLeast1.kt b/backend.native/tests/external/codegen/boxInline/bytecodePreprocessing/apiVersionAtLeast1.kt new file mode 100644 index 00000000000..b5364190bb1 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/bytecodePreprocessing/apiVersionAtLeast1.kt @@ -0,0 +1,41 @@ +// TARGET_BACKEND: JVM +// FILE: 1.kt +package kotlin.internal + +fun apiVersionIsAtLeast(epic: Int, major: Int, minor: Int): Boolean { + return false +} + +var properFunctionWasClled = false + +fun doSomethingNew() { + properFunctionWasClled = true +} + +fun doSomethingOld() { + throw AssertionError("Should not be called") +} + +inline fun versionDependentInlineFun() { + if (apiVersionIsAtLeast(1, 1, 0)) { + doSomethingNew() + } + else { + doSomethingOld() + } +} + +fun test() { + versionDependentInlineFun() +} + + +// FILE: 2.kt +import kotlin.internal.* + +fun box(): String { + test() + if (!properFunctionWasClled) return "Fail 1" + + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/callableReference/bound/kt18728.kt b/backend.native/tests/external/codegen/boxInline/callableReference/bound/kt18728.kt new file mode 100644 index 00000000000..8da9f6097a1 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/callableReference/bound/kt18728.kt @@ -0,0 +1,16 @@ +// FILE: 1.kt + +package test + +inline fun T.map(transform: (T) -> R): R { + return transform(this) +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + val result = 1.map(2::plus) + return if (result == 3) "OK" else "fail $result" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/callableReference/bound/kt18728_2.kt b/backend.native/tests/external/codegen/boxInline/callableReference/bound/kt18728_2.kt new file mode 100644 index 00000000000..164bc0ee3ec --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/callableReference/bound/kt18728_2.kt @@ -0,0 +1,16 @@ +// FILE: 1.kt + +package test + +inline fun T.map(transform: (T) -> R): R { + return transform(this) +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + val result = 1.map(3L::plus) + return if (result == 4L) "OK" else "fail $result" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/callableReference/bound/kt18728_3.kt b/backend.native/tests/external/codegen/boxInline/callableReference/bound/kt18728_3.kt new file mode 100644 index 00000000000..40df3101338 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/callableReference/bound/kt18728_3.kt @@ -0,0 +1,19 @@ +// FILE: 1.kt + +package test + +inline fun map(transform: () -> R): R { + return transform() +} + +// FILE: 2.kt + +import test.* + +val Int.myInc + get() = this + 1 + +fun box(): String { + val result = map(2::myInc) + return if (result == 3) "OK" else "fail $result" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/callableReference/bound/kt18728_4.kt b/backend.native/tests/external/codegen/boxInline/callableReference/bound/kt18728_4.kt new file mode 100644 index 00000000000..0bcc8fd80d4 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/callableReference/bound/kt18728_4.kt @@ -0,0 +1,18 @@ +// FILE: 1.kt + +package test + +inline fun map(transform: () -> R): R { + return transform() +} + +// FILE: 2.kt + +import test.* +val Long.myInc + get() = this + 1 + +fun box(): String { + val result = map(2L::myInc) + return if (result == 3L) "OK" else "fail $result" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/callableReference/bound/mixed.kt b/backend.native/tests/external/codegen/boxInline/callableReference/bound/mixed.kt new file mode 100644 index 00000000000..426984d7d1e --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/callableReference/bound/mixed.kt @@ -0,0 +1,23 @@ +// FILE: 1.kt + +package test + +class Foo { + fun foo() = "OK" + fun foo2() = "OK2" +} + +inline fun inlineFn(a: String, crossinline fn: () -> String, x: Long = 1, crossinline fn2: () -> String, c: String): String { + return a + fn() + x + fn2() + c +} + +// FILE: 2.kt + +import test.* + +private val foo = Foo() + +fun box(): String { + val result = inlineFn("a", foo::foo, 5, foo::foo2, "end") + return if (result == "aOK5OK2end") "OK" else "fail: $result" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/33Parameters.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/33Parameters.kt new file mode 100644 index 00000000000..50a8bbc1fa4 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/33Parameters.kt @@ -0,0 +1,53 @@ +// FILE: 1.kt + +package test + +fun calc() = "OK" + +inline fun String.test() = this + +fun test( + p1: String = "1", + p2: String = "2", + p3: String = "3", + p4: String = "4", + p5: String = "5", + p6: String = "6", + p7: String = "7", + p8: String = "8", + p9: String = "9", + p10: String = "10", + p11: String = "11", + p12: String = "12", + p13: String = "13", + p14: String = "O".test(), + p15: String = "15", + p16: String = "16", + p17: String = "17", + p18: String = "18", + p19: String = "19", + p20: String = "20", + p21: String = "21", + p22: String = "22", + p23: String = "23", + p24: String = "24", + p25: String = "25", + p26: String = "26", + p27: String = "27", + p28: String = "28", + p29: String = "29", + p30: String = "30", + p31: String = "31", + p32: String = "32", + p33: String = "K".test() +): String { + return p14 + p33 +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + return test() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/33ParametersInConstructor.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/33ParametersInConstructor.kt new file mode 100644 index 00000000000..e0d10b91911 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/33ParametersInConstructor.kt @@ -0,0 +1,51 @@ +// FILE: 1.kt + +package test + +fun calc() = "OK" + +inline fun String.test() = this + +class Test( + p1: String = "1", + p2: String = "2", + p3: String = "3", + p4: String = "4", + p5: String = "5", + p6: String = "6", + p7: String = "7", + p8: String = "8", + p9: String = "9", + p10: String = "10", + p11: String = "11", + p12: String = "12", + p13: String = "13", + val p14: String = "O".test(), + p15: String = "15", + p16: String = "16", + p17: String = "17", + p18: String = "18", + p19: String = "19", + p20: String = "20", + p21: String = "21", + p22: String = "22", + p23: String = "23", + p24: String = "24", + p25: String = "25", + p26: String = "26", + p27: String = "27", + p28: String = "28", + p29: String = "29", + p30: String = "30", + p31: String = "31", + p32: String = "32", + val p33: String = "K".test() +) +// FILE: 2.kt + +import test.* + +fun box(): String { + val test = Test() + return test.p14 + test.p33 +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/inlineLambdaInNoInlineDefault.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/inlineLambdaInNoInlineDefault.kt new file mode 100644 index 00000000000..ddfd491cc90 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/inlineLambdaInNoInlineDefault.kt @@ -0,0 +1,16 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +inline fun inlineFun(crossinline inlineLambda: () -> String, noinline noInlineLambda: () -> String = { inlineLambda() }): String { + return noInlineLambda() +} + +// FILE: 2.kt +//NO_CHECK_LAMBDA_INLINING +import test.* + +fun box(): String { + return inlineFun({ "OK" }) +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/kt18689.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/kt18689.kt new file mode 100644 index 00000000000..f64cd2306d2 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/kt18689.kt @@ -0,0 +1,21 @@ +// FILE: 1.kt + +package test + +class Foo { + fun foo() = "OK" +} + +inline fun inlineFn(crossinline fn: () -> String, x: Int? = 1): String { + return fn() +} + +// FILE: 2.kt + +import test.* + +private val foo = Foo() + +fun box(): String { + return inlineFn(foo::foo) +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/kt18689_2.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/kt18689_2.kt new file mode 100644 index 00000000000..5ad6a07bf34 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/kt18689_2.kt @@ -0,0 +1,21 @@ +// FILE: 1.kt + +package test + +class Foo { + fun foo() = "O" +} + +inline fun inlineFn(crossinline fn: () -> String, x: String = "K"): String { + return fn() + x +} + +// FILE: 2.kt + +import test.* + +private val foo = Foo() + +fun box(): String { + return inlineFn(foo::foo) +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/kt18689_3.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/kt18689_3.kt new file mode 100644 index 00000000000..137eaa4138d --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/kt18689_3.kt @@ -0,0 +1,21 @@ +// FILE: 1.kt + +package test + +class Foo { + fun foo() = "O" +} + +inline fun inlineFn(crossinline fn: () -> String, x: String = "X"): String { + return fn() + x +} + +// FILE: 2.kt + +import test.* + +private val foo = Foo() + +fun box(): String { + return inlineFn(foo::foo, "K") +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/kt18689_4.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/kt18689_4.kt new file mode 100644 index 00000000000..23c19b4b11d --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/kt18689_4.kt @@ -0,0 +1,21 @@ +// FILE: 1.kt + +package test + +class Foo { + fun foo() = "OK" +} + +inline fun inlineFn(crossinline fn: () -> String, x: Long = 1L): String { + return fn() +} + +// FILE: 2.kt + +import test.* + +private val foo = Foo() + +fun box(): String { + return inlineFn(foo::foo) +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReference.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReference.kt new file mode 100644 index 00000000000..70154e97dfe --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReference.kt @@ -0,0 +1,20 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +class A(val value: String) { + fun ok() = value +} + +inline fun inlineFun(a: A, lambda: () -> String = a::ok): String { + return lambda() +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + return inlineFun(A("OK")) +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnInt.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnInt.kt new file mode 100644 index 00000000000..9fd1b67261d --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnInt.kt @@ -0,0 +1,17 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +inline fun inlineFun(a: Int, lambda: (Int) -> Int = 1::plus): Int { + return lambda(a) +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + val result = inlineFun(2) + return if (result == 3) return "OK" else "fail $result" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnLong.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnLong.kt new file mode 100644 index 00000000000..9fd1b67261d --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundFunctionReferenceOnLong.kt @@ -0,0 +1,17 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +inline fun inlineFun(a: Int, lambda: (Int) -> Int = 1::plus): Int { + return lambda(a) +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + val result = inlineFun(2) + return if (result == 3) return "OK" else "fail $result" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReference.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReference.kt new file mode 100644 index 00000000000..83bb3f0b7c9 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReference.kt @@ -0,0 +1,18 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +class A(val ok: String) + +inline fun inlineFun(a: A, lambda: () -> String = a::ok): String { + return lambda() +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + return inlineFun(A("OK")) +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnInt.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnInt.kt new file mode 100644 index 00000000000..18acbd44ecd --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnInt.kt @@ -0,0 +1,21 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +val Int.myInc + get() = this + 1 + + +inline fun inlineFun(lambda: () -> Int = 1::myInc): Int { + return lambda() +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + val result = inlineFun() + return if (result == 2) return "OK" else "fail $result" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnLong.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnLong.kt new file mode 100644 index 00000000000..250edbe0877 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/boundPropertyReferenceOnLong.kt @@ -0,0 +1,21 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +val Long.myInc + get() = this + 1 + + +inline fun inlineFun(lambda: () -> Long = 1L::myInc): Long { + return lambda() +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + val result = inlineFun() + return if (result == 2L) return "OK" else "fail $result" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/constuctorReference.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/constuctorReference.kt new file mode 100644 index 00000000000..b953e910015 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/constuctorReference.kt @@ -0,0 +1,20 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +class A(val value: String) { + fun ok() = value +} + +inline fun inlineFun(a: String, lambda: (String) -> A = ::A): A { + return lambda(a) +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + return inlineFun("OK").value +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/functionImportedFromObject.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/functionImportedFromObject.kt new file mode 100644 index 00000000000..98b9e147958 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/functionImportedFromObject.kt @@ -0,0 +1,24 @@ +// FILE: 1.kt +package test + +fun ok() = "OK" + +object A { + fun ok() = "OK" +} + +inline fun stub() {} + + +// FILE: 2.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +import test.A.ok + +inline fun inlineFun(lambda: () -> String = ::ok): String { + return lambda() +} + +fun box(): String { + return inlineFun() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/functionReference.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/functionReference.kt similarity index 85% rename from backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/functionReference.kt rename to backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/functionReference.kt index 0096c923ab8..ae652db6fc2 100644 --- a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/functionReference.kt +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/functionReference.kt @@ -1,10 +1,10 @@ // FILE: 1.kt +// LANGUAGE_VERSION: 1.2 // SKIP_INLINE_CHECK_IN: inlineFun$default package test fun ok() = "OK" -@Suppress("NOT_YET_SUPPORTED_IN_INLINE") inline fun inlineFun(lambda: () -> String = ::ok): String { return lambda() } diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/functionReferenceFromClass.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/functionReferenceFromClass.kt similarity index 83% rename from backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/functionReferenceFromClass.kt rename to backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/functionReferenceFromClass.kt index 7581a0e2e06..b979f06a998 100644 --- a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/functionReferenceFromClass.kt +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/functionReferenceFromClass.kt @@ -1,15 +1,12 @@ // FILE: 1.kt +// LANGUAGE_VERSION: 1.2 // SKIP_INLINE_CHECK_IN: inlineFun$default package test -fun ok() = "OK" - class A(val value: String) { fun ok() = value } - -@Suppress("NOT_YET_SUPPORTED_IN_INLINE") inline fun inlineFun(a: A, lambda: (A) -> String = A::ok): String { return lambda(a) } diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/functionReferenceFromObject.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/functionReferenceFromObject.kt new file mode 100644 index 00000000000..cd1d2d67bd9 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/functionReferenceFromObject.kt @@ -0,0 +1,22 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +fun ok() = "OK" + +object A { + fun ok() = "OK" +} + +inline fun inlineFun(lambda: () -> String = A::ok): String { + return lambda() +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + return inlineFun() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/innerClassConstuctorReference.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/innerClassConstuctorReference.kt new file mode 100644 index 00000000000..3c1e468291e --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/innerClassConstuctorReference.kt @@ -0,0 +1,23 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +class A(val value: String) { + + inner class Inner { + fun ok() = value + } +} + +inline fun inlineFun(a: A, lambda: () -> A.Inner = a::Inner): A.Inner { + return lambda() +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + return inlineFun(A("OK")).ok() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/privateFunctionReference.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/privateFunctionReference.kt new file mode 100644 index 00000000000..9daf1aa9f06 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/privateFunctionReference.kt @@ -0,0 +1,18 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +private fun ok() = "OK" + +internal inline fun inlineFun(lambda: () -> String = ::ok): String { + return lambda() +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + return inlineFun() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/privatePropertyReference.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/privatePropertyReference.kt new file mode 100644 index 00000000000..4514cfd5a70 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/privatePropertyReference.kt @@ -0,0 +1,18 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +private val ok = "OK" + +internal inline fun inlineFun(lambda: () -> String = ::ok): String { + return lambda() +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + return inlineFun() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/propertyImportedFromObject.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/propertyImportedFromObject.kt new file mode 100644 index 00000000000..c09d36b5d90 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/propertyImportedFromObject.kt @@ -0,0 +1,21 @@ +// FILE: 1.kt +package test + +object A { + val ok = "OK" +} +inline fun stub() {} + + +// FILE: 2.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +import test.A.ok + +inline fun inlineFun(lambda: () -> String = ::ok): String { + return lambda() +} + +fun box(): String { + return inlineFun() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/propertyReference.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/propertyReference.kt new file mode 100644 index 00000000000..aaa25f84e3c --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/propertyReference.kt @@ -0,0 +1,18 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +val ok = "OK" + +inline fun inlineFun(lambda: () -> String = ::ok): String { + return lambda() +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + return inlineFun() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/propertyReferenceFromClass.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/propertyReferenceFromClass.kt new file mode 100644 index 00000000000..ba9f84bcb56 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/propertyReferenceFromClass.kt @@ -0,0 +1,18 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +class A(val ok: String) + +inline fun inlineFun(a: A, lambda: (A) -> String = A::ok): String { + return lambda(a) +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + return inlineFun(A("OK")) +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/propertyReferenceFromObject.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/propertyReferenceFromObject.kt new file mode 100644 index 00000000000..e569fdf7d8b --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/callableReferences/propertyReferenceFromObject.kt @@ -0,0 +1,20 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +object A { + val ok = "OK" +} + +inline fun inlineFun(lambda: () -> String = A::ok): String { + return lambda() +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + return inlineFun() +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/defaultLambdaInNoInline.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/defaultLambdaInNoInline.kt index 4cce7c03858..5ffab7914d9 100644 --- a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/defaultLambdaInNoInline.kt +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/defaultLambdaInNoInline.kt @@ -1,14 +1,15 @@ // FILE: 1.kt +// LANGUAGE_VERSION: 1.2 // SKIP_INLINE_CHECK_IN: inlineFun$default package test -@Suppress("NOT_YET_SUPPORTED_IN_INLINE") inline fun inlineFun(crossinline inlineLambda: () -> String = { "OK" }, noinline noInlineLambda: () -> String = { inlineLambda() }): String { return noInlineLambda() } // FILE: 2.kt //NO_CHECK_LAMBDA_INLINING +// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda_0 scope=box import test.* fun box(): String { diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/instanceCapuredInClass.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/instanceCapuredInClass.kt index fcd850a0fed..080ee06cd0e 100644 --- a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/instanceCapuredInClass.kt +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/instanceCapuredInClass.kt @@ -1,10 +1,10 @@ // FILE: 1.kt +// LANGUAGE_VERSION: 1.2 // SKIP_INLINE_CHECK_IN: inlineFun$default package test class A(val value: String) { - @Suppress("NOT_YET_SUPPORTED_IN_INLINE") inline fun inlineFun(lambda: () -> String = { value }): String { return lambda() } @@ -14,6 +14,7 @@ class A(val value: String) { import test.* +// CHECK_CONTAINS_NO_CALLS: box fun box(): String { return A("OK").inlineFun() } \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/instanceCapuredInInterface.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/instanceCapuredInInterface.kt index 4403fc16815..05608dbb358 100644 --- a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/instanceCapuredInInterface.kt +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/instanceCapuredInInterface.kt @@ -1,5 +1,7 @@ // FILE: 1.kt +// LANGUAGE_VERSION: 1.2 // SKIP_INLINE_CHECK_IN: inlineFun$default +// CHECK_CONTAINS_NO_CALLS: test package test //problem in test framework @@ -10,7 +12,6 @@ interface A { fun test() = inlineFun() - @Suppress("NOT_YET_SUPPORTED_IN_INLINE") private inline fun inlineFun(lambda: () -> String = { value }): String { return lambda() } diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/jvmStaticDefault.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/jvmStaticDefault.kt index 7d80244b3fe..94f9a3e282d 100644 --- a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/jvmStaticDefault.kt +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/jvmStaticDefault.kt @@ -1,12 +1,12 @@ // FILE: 1.kt +// LANGUAGE_VERSION: 1.2 // SKIP_INLINE_CHECK_IN: inlineFun$default -// IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: JS, NATIVE //WITH_RUNTIME package test object X { @JvmStatic - @Suppress("NOT_YET_SUPPORTED_IN_INLINE") inline fun inlineFun(capturedParam: String, lambda: () -> String = { capturedParam }): String { return lambda() } diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/noInline.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/noInline.kt index 8195603eb01..2f9c2618cc3 100644 --- a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/noInline.kt +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/noInline.kt @@ -9,6 +9,8 @@ fun call(lambda: () -> String ) = lambda() // FILE: 2.kt //NO_CHECK_LAMBDA_INLINING +// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda scope=box +// CHECK_CALLED_IN_SCOPE: function=call scope=box import test.* fun box(): String { diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/nonDefaultInlineInNoInline.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/nonDefaultInlineInNoInline.kt index f70777467fe..abe5059b0e8 100644 --- a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/nonDefaultInlineInNoInline.kt +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/nonDefaultInlineInNoInline.kt @@ -1,14 +1,15 @@ // FILE: 1.kt +// LANGUAGE_VERSION: 1.2 // SKIP_INLINE_CHECK_IN: inlineFun$default package test -@Suppress("NOT_YET_SUPPORTED_IN_INLINE") inline fun inlineFun(crossinline inlineLambda: () -> String, noinline noInlineLambda: () -> String = { inlineLambda() }): String { return noInlineLambda() } // FILE: 2.kt //NO_CHECK_LAMBDA_INLINING +// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda scope=inlineFun import test.* fun box(): String { diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/receiverClash.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/receiverClash.kt new file mode 100644 index 00000000000..f5367e6f018 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/receiverClash.kt @@ -0,0 +1,21 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +inline fun String.inlineFun(crossinline lambda: () -> String = { this }): String { + return { + this + lambda() + }() +} + +// FILE: 2.kt +// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda scope=box +// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda_0 scope=box + +import test.* + +fun box(): String { + val result = "OK".inlineFun() + return if (result == "OKOK") "OK" else "fail 1: $result" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/receiverClash2.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/receiverClash2.kt new file mode 100644 index 00000000000..7a8f71ffc8b --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/receiverClash2.kt @@ -0,0 +1,22 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +inline fun String.inlineFun(crossinline lambda: () -> String, crossinline dlambda: () -> String = { this }): String { + return { + "${this} ${lambda()} ${dlambda()}" + }() +} + +// FILE: 2.kt +// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda_0 scope=test +// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda scope=test +import test.* + +fun String.test(): String = "INLINE".inlineFun({ this }) + +fun box(): String { + val result = "TEST".test() + return if (result == "INLINE TEST INLINE") "OK" else "fail 1: $result" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/receiverClashInClass.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/receiverClashInClass.kt new file mode 100644 index 00000000000..75d74f77eb1 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/receiverClashInClass.kt @@ -0,0 +1,24 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +class A(val value: String) { + + inline fun String.inlineFun(crossinline lambda: () -> String = { this }): String { + return { + "$value ${this} ${lambda()}" + }() + } +} + +// FILE: 2.kt +//WITH_RUNTIME +// CHECK_CALLED_IN_SCOPE: function=A$inlineFun$lambda scope=box +// CHECK_CALLED_IN_SCOPE: function=A$inlineFun$lambda_0 scope=box +import test.* + +fun box(): String { + val result = with(A("VALUE")) { "OK".inlineFun() } + return if (result == "VALUE OK OK") "OK" else "fail 1: $result" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/receiverClashInClass2.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/receiverClashInClass2.kt new file mode 100644 index 00000000000..11117e9422a --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/receiverClashInClass2.kt @@ -0,0 +1,26 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +class A(val value: String) { + + inline fun String.inlineFun(crossinline lambda: () -> String, crossinline dlambda: () -> String = { this }): String { + return { + "$value ${this} ${lambda()} ${dlambda()}" + }() + } +} + +// FILE: 2.kt +//WIH_RUNTIME +// CHECK_CALLED_IN_SCOPE: function=A$inlineFun$lambda scope=test +// CHECK_CALLED_IN_SCOPE: function=A$inlineFun$lambda_0 scope=test +import test.* + +fun String.test(): String = with(A("VALUE")) { "INLINE".inlineFun({ this@test }) } + +fun box(): String { + val result = "TEST".test() + return if (result == "VALUE INLINE TEST INLINE") "OK" else "fail 1: $result" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simple.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simple.kt index 4a1821c3654..e032606205d 100644 --- a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simple.kt +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simple.kt @@ -1,13 +1,14 @@ // FILE: 1.kt +// LANGUAGE_VERSION: 1.2 // SKIP_INLINE_CHECK_IN: inlineFun$default package test -@Suppress("NOT_YET_SUPPORTED_IN_INLINE") inline fun inlineFun(capturedParam: String, lambda: () -> String = { capturedParam }): String { return lambda() } // FILE: 2.kt +// CHECK_CONTAINS_NO_CALLS: box import test.* diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleErased.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleErased.kt index 4f0013b2f62..2171f31be46 100644 --- a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleErased.kt +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleErased.kt @@ -1,13 +1,14 @@ // FILE: 1.kt +// LANGUAGE_VERSION: 1.2 // SKIP_INLINE_CHECK_IN: inlineFun$default package test -@Suppress("NOT_YET_SUPPORTED_IN_INLINE") inline fun inlineFun(capturedParam: String, lambda: () -> Any = { capturedParam as Any }): Any { return lambda() } // FILE: 2.kt +// CHECK_CONTAINS_NO_CALLS: box except=throwCCE;isType import test.* diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleErasedStaticInstance.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleErasedStaticInstance.kt index 4833e45f13b..ebd9a91bed9 100644 --- a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleErasedStaticInstance.kt +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleErasedStaticInstance.kt @@ -1,13 +1,14 @@ // FILE: 1.kt +// LANGUAGE_VERSION: 1.2 // SKIP_INLINE_CHECK_IN: inlineFun$default package test -@Suppress("NOT_YET_SUPPORTED_IN_INLINE") inline fun inlineFun(lambda: () -> Any = { "OK" as Any }): Any { return lambda() } // FILE: 2.kt +// CHECK_CONTAINS_NO_CALLS: box except=throwCCE;isType import test.* diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleExtension.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleExtension.kt new file mode 100644 index 00000000000..29c9f3dac2d --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleExtension.kt @@ -0,0 +1,17 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +inline fun inlineFun(param: String, lambda: String.() -> String = { this }): String { + return param.lambda() +} + +// FILE: 2.kt +// CHECK_CONTAINS_NO_CALLS: box + +import test.* + +fun box(): String { + return inlineFun("OK") +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleGeneric.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleGeneric.kt index 676adcb7f8d..3a91a6322ec 100644 --- a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleGeneric.kt +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleGeneric.kt @@ -1,4 +1,5 @@ // FILE: 1.kt +// LANGUAGE_VERSION: 1.2 // SKIP_INLINE_CHECK_IN: inlineFun$default package test @@ -6,12 +7,12 @@ open class A(val value: String) class B(value: String): A(value) -@Suppress("NOT_YET_SUPPORTED_IN_INLINE") inline fun inlineFun(capturedParam: T, lambda: () -> T = { capturedParam }): T { return lambda() } // FILE: 2.kt +// CHECK_CONTAINS_NO_CALLS: box import test.* diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleStaticInstance.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleStaticInstance.kt index 85403783e77..fb8a67b97ac 100644 --- a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleStaticInstance.kt +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/simpleStaticInstance.kt @@ -1,13 +1,14 @@ // FILE: 1.kt +// LANGUAGE_VERSION: 1.2 // SKIP_INLINE_CHECK_IN: inlineFun$default package test -@Suppress("NOT_YET_SUPPORTED_IN_INLINE") inline fun inlineFun(lambda: () -> String = { "OK" }): String { return lambda() } // FILE: 2.kt +// CHECK_CONTAINS_NO_CALLS: box import test.* diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/thisClash.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/thisClash.kt new file mode 100644 index 00000000000..ecfd75bc120 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/thisClash.kt @@ -0,0 +1,23 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +inline fun String.inlineFun(crossinline lambda: () -> String = { { this }() }): String { + return { + { + this + lambda() + }() + }() +} + +// FILE: 2.kt +// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda scope=box +// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda_0 scope=box + +import test.* + +fun box(): String { + val result = "OK".inlineFun() + return if (result == "OKOK") "OK" else "fail 1: $result" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/thisClashInClass.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/thisClashInClass.kt new file mode 100644 index 00000000000..e6f5016471d --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/lambdaInlining/thisClashInClass.kt @@ -0,0 +1,25 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +class A(val value: String) { + inline fun String.inlineFun(crossinline lambda: () -> String = { { this }() }): String { + return { + { + this + lambda() + }() + }() + } +} + +// FILE: 2.kt +//WITH_RUNTIME +// CHECK_CALLED_IN_SCOPE: function=A$inlineFun$lambda scope=box +// CHECK_CALLED_IN_SCOPE: function=A$inlineFun$lambda_0 scope=box +import test.* + +fun box(): String { + val result = with(A("VALUE")) { "OK".inlineFun() } + return if (result == "OKOK") "OK" else "fail 1: $result" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/maskElimination/kt18792.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/maskElimination/kt18792.kt new file mode 100644 index 00000000000..24ea76ce57c --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/maskElimination/kt18792.kt @@ -0,0 +1,21 @@ +// FILE: 1.kt +//WITH_RUNTIME + +package test + +class SceneContainer2() { + + inline fun pushTo(time: Long = 0.seconds, transition: String = "TR"): String { + return "OK" + } +} + +inline val Number.seconds: Long get() = this.toLong() + +// FILE: 2.kt + +import test.* + +fun box(): String { + return SceneContainer2().pushTo(time = 0.2.seconds) +} diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/maskElimination/kt19679.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/maskElimination/kt19679.kt new file mode 100644 index 00000000000..046b61f6bd1 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/maskElimination/kt19679.kt @@ -0,0 +1,19 @@ +// FILE: 1.kt +package test + +inline fun build(func: () -> Unit, noinline pathFunc: (() -> String)? = null) { + func() + + pathFunc?.invoke() +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + var result = "fail" + build({ result = "OK" }) + + return result +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/maskElimination/kt19679_2.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/maskElimination/kt19679_2.kt new file mode 100644 index 00000000000..001a65f8d62 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/maskElimination/kt19679_2.kt @@ -0,0 +1,15 @@ +// FILE: 1.kt +package test + +inline fun build(noinline pathFunc: (() -> String)? = null) { + pathFunc?.invoke() +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + build () + return "OK" +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/maskElimination/kt19679_3.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/maskElimination/kt19679_3.kt new file mode 100644 index 00000000000..8a8385a6857 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/maskElimination/kt19679_3.kt @@ -0,0 +1,20 @@ +// FILE: 1.kt +package test + +@Suppress("NULLABLE_INLINE_PARAMETER") +inline fun build(func: () -> Unit, pathFunc: (() -> String)? = null) { + func() + + pathFunc?.invoke() +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + var result = "fail" + build ({ result = "OK" }) + + return result +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/defaultValues/varArgNoInline.kt b/backend.native/tests/external/codegen/boxInline/defaultValues/varArgNoInline.kt new file mode 100644 index 00000000000..bfd1c940bc5 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/defaultValues/varArgNoInline.kt @@ -0,0 +1,20 @@ +// FILE: 1.kt +//WITH_RUNTIME +package test + +var res = "" + +inline fun inlineFun(vararg s : () -> String = arrayOf({ "OK" })) { + for (p in s) { + res += p() + } +} + +// FILE: 2.kt +//NO_CHECK_LAMBDA_INLINING +import test.* + +fun box(): String { + inlineFun() + return res +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/delegatedProperty/kt16864.kt b/backend.native/tests/external/codegen/boxInline/delegatedProperty/kt16864.kt new file mode 100644 index 00000000000..0261b5f3b00 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/delegatedProperty/kt16864.kt @@ -0,0 +1,23 @@ +// FILE: 1.kt +package test + + +inline fun mrun(lambda: () -> T): T = lambda() + + +// FILE: 2.kt +// NO_CHECK_LAMBDA_INLINING +import test.* + +object Whatever { + operator fun getValue(thisRef: Any?, prop: Any?) = "OK" +} + +fun box(): String { + val key by Whatever + return mrun { + object { + val keys = key + }.keys + } +} \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/delegatedProperty/localInAnonymousObject.kt b/backend.native/tests/external/codegen/boxInline/delegatedProperty/localInAnonymousObject.kt new file mode 100644 index 00000000000..c098619f778 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/delegatedProperty/localInAnonymousObject.kt @@ -0,0 +1,26 @@ +// FILE: 1.kt +package test + +import kotlin.reflect.KProperty + +class Delegate { + operator fun getValue(t: Any?, p: KProperty<*>): String = "O" +} + +inline fun test(crossinline s: () -> String): String { + val delegate = Delegate() + val o = object { + fun run(): String { + val prop: String by delegate + return prop + s() + } + } + return o.run() +} + +// FILE: 2.kt +import test.* + +fun box(): String { + return test { "K" } +} diff --git a/backend.native/tests/external/codegen/boxInline/delegatedProperty/localInLambda.kt b/backend.native/tests/external/codegen/boxInline/delegatedProperty/localInLambda.kt new file mode 100644 index 00000000000..851a60fab73 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/delegatedProperty/localInLambda.kt @@ -0,0 +1,23 @@ +// FILE: 1.kt +package test + +import kotlin.reflect.KProperty + +class Delegate { + operator fun getValue(t: Any?, p: KProperty<*>): String = "OK" +} + +inline fun test(): String { + val b by Delegate() + + return run { + b + } +} + +// FILE: 2.kt +import test.* + +fun box(): String { + return test() +} diff --git a/backend.native/tests/external/codegen/boxInline/jvmPackageName/simple.kt b/backend.native/tests/external/codegen/boxInline/jvmPackageName/simple.kt new file mode 100644 index 00000000000..a68cc6dd26d --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/jvmPackageName/simple.kt @@ -0,0 +1,21 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// LANGUAGE_VERSION: 1.2 + +// FILE: 1.kt + +@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") +@file:JvmPackageName("baz.foo.quux.bar") +package foo.bar + +fun f(): String = "O" + +val g: String? get() = "K" + +inline fun i(block: () -> T): T = block() + +// FILE: 2.kt + +import foo.bar.* + +fun box(): String = i { f() + g } diff --git a/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/chain.kt b/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/chain.kt new file mode 100644 index 00000000000..ade2ba1de34 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/chain.kt @@ -0,0 +1,26 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +//WITH_RUNTIME +package test + +class OK +class FAIL + +inline fun inlineFun(lambda: () -> String = { T::class.java.simpleName }): String { + return lambda() +} + +inline fun inlineFun2(): String { + return inlineFun() +} + +// FILE: 2.kt + +import test.* + + + +fun box(): String { + return inlineFun2() +} diff --git a/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/nested.kt b/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/nested.kt new file mode 100644 index 00000000000..bdf91ef4d79 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/nested.kt @@ -0,0 +1,19 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +//WITH_RUNTIME +package test + +inline fun inlineFun(p: String, lambda: () -> String = { { p + T::class.java.simpleName } () }): String { + return lambda() +} + +// FILE: 2.kt +//NO_CHECK_LAMBDA_INLINING +import test.* + +class K + +fun box(): String { + return inlineFun("O") +} diff --git a/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/nested2.kt b/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/nested2.kt new file mode 100644 index 00000000000..2eabf83cb9d --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/nested2.kt @@ -0,0 +1,21 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +//WITH_RUNTIME +package test + +inline fun inlineFun(p: String, crossinline lambda: () -> String = { { p + T::class.java.simpleName } () }): String { + return { + lambda() + } () +} + +// FILE: 2.kt + +import test.* + +class K + +fun box(): String { + return inlineFun("O") +} diff --git a/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/nested2Static.kt b/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/nested2Static.kt new file mode 100644 index 00000000000..9c59aaad2f1 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/nested2Static.kt @@ -0,0 +1,21 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +//WITH_RUNTIME +package test + +inline fun inlineFun(crossinline lambda: () -> String = { { T::class.java.simpleName } () }): String { + return { + lambda() + } () +} + +// FILE: 2.kt + +import test.* + +class OK + +fun box(): String { + return inlineFun() +} diff --git a/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/nestedStatic.kt b/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/nestedStatic.kt new file mode 100644 index 00000000000..436c121116f --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/nestedStatic.kt @@ -0,0 +1,19 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +//WITH_RUNTIME +package test + +inline fun inlineFun(lambda: () -> String = { { T::class.java.simpleName } () }): String { + return lambda() +} + +// FILE: 2.kt +//NO_CHECK_LAMBDA_INLINING +import test.* + +class OK + +fun box(): String { + return inlineFun() +} diff --git a/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/simple.kt b/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/simple.kt new file mode 100644 index 00000000000..013bfa50b5a --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/simple.kt @@ -0,0 +1,19 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +//WITH_RUNTIME +package test + +inline fun inlineFun(lambda: () -> String = { T::class.java.simpleName }): String { + return lambda() +} + +// FILE: 2.kt + +import test.* + +class OK + +fun box(): String { + return inlineFun() +} diff --git a/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/transitiveChain.kt b/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/transitiveChain.kt new file mode 100644 index 00000000000..bb32101cb7d --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/transitiveChain.kt @@ -0,0 +1,23 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +//WITH_RUNTIME +package test + +class K + +inline fun inlineFun(p: String, lambda: () -> String = { p + T::class.java.simpleName }): String { + return lambda() +} + +inline fun inlineFun2(p: String): String { + return inlineFun(p) +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + return inlineFun2("O") +} diff --git a/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/transitiveChainStatic.kt b/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/transitiveChainStatic.kt new file mode 100644 index 00000000000..24f5a953023 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/reified/defaultLambda/transitiveChainStatic.kt @@ -0,0 +1,26 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +//WITH_RUNTIME +package test + +class OK +class FAIL + +inline fun inlineFun(lambda: () -> String = { T::class.java.simpleName }): String { + return lambda() +} + +inline fun inlineFun2(): String { + return inlineFun() +} + +// FILE: 2.kt + +import test.* + + + +fun box(): String { + return inlineFun2() +} diff --git a/backend.native/tests/external/codegen/boxInline/smap/anonymous/kt19175.kt b/backend.native/tests/external/codegen/boxInline/smap/anonymous/kt19175.kt new file mode 100644 index 00000000000..2622e875a44 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/smap/anonymous/kt19175.kt @@ -0,0 +1,79 @@ +// FILE: 1.kt +package test + +abstract class Introspector { + abstract inner class SchemaRetriever(val transaction: String) { + inline fun inSchema(crossinline modifier: (String) -> Unit) = + { modifier.invoke(transaction) }() + } +} + +// FILE: 2.kt +import test.* + +var result = "fail" + +class IntrospectorImpl() : Introspector() { + inner class SchemaRetriever(transaction: String) : Introspector.SchemaRetriever(transaction) { + internal fun retrieve() { + inSchema { schema -> result = schema } + } + } +} + +fun box(): String { + IntrospectorImpl().SchemaRetriever("OK").retrieve() + + return result +} + + +// FILE: 1.smap + +SMAP +1.kt +Kotlin +*S Kotlin +*F ++ 1 1.kt +test/Introspector$SchemaRetriever$inSchema$1 +*L +1#1,11:1 +*E + +// FILE: 2.smap + +SMAP +2.kt +Kotlin +*S Kotlin +*F ++ 1 2.kt +IntrospectorImpl$SchemaRetriever ++ 2 1.kt +test/Introspector$SchemaRetriever +*L +1#1,21:1 +7#2:22 +*E +*S KotlinDebug +*F ++ 1 2.kt +IntrospectorImpl$SchemaRetriever +*L +9#1:22 +*E + +SMAP +1.kt +Kotlin +*S Kotlin +*F ++ 1 1.kt +test/Introspector$SchemaRetriever$inSchema$1 ++ 2 2.kt +IntrospectorImpl$SchemaRetriever +*L +1#1,11:1 +9#2:12 +*E \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/smap/defaultFunction.kt b/backend.native/tests/external/codegen/boxInline/smap/defaultFunction.kt new file mode 100644 index 00000000000..55690f78727 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/smap/defaultFunction.kt @@ -0,0 +1,41 @@ +// FILE: 1.kt +package test + +inline fun inlineFun(capturedParam: String, noinline lambda: () -> String = { capturedParam }): String { + return lambda() +} + +// FILE: 2.kt +//NO_CHECK_LAMBDA_INLINING +import test.* + +fun box(): String { + return inlineFun("OK") +} + +// FILE: 1.smap +//TODO maybe do smth with default method body mapping +SMAP +1.kt +Kotlin +*S Kotlin +*F ++ 1 1.kt +test/_1Kt +*L +1#1,8:1 +5#1:9 +*E + +SMAP +1.kt +Kotlin +*S Kotlin +*F ++ 1 1.kt +test/_1Kt$inlineFun$1 +*L +1#1,8:1 +*E + +// FILE: 2.TODO \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/smap/defaultLambda/nested.kt b/backend.native/tests/external/codegen/boxInline/smap/defaultLambda/nested.kt new file mode 100644 index 00000000000..c017cf99481 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/smap/defaultLambda/nested.kt @@ -0,0 +1,91 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +inline fun inlineFun(capturedParam: String, crossinline lambda: () -> String = { capturedParam }): String { + return { + lambda() + }() +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + return inlineFun("OK") +} + +// FILE: 1.smap +//TODO maybe do smth with default method body mapping +SMAP +1.kt +Kotlin +*S Kotlin +*F ++ 1 1.kt +test/_1Kt +*L +1#1,12:1 +7#1:13 +*E + +SMAP +1.kt +Kotlin +*S Kotlin +*F ++ 1 1.kt +test/_1Kt$inlineFun$2 +*L +1#1,12:1 +*E + +SMAP +1.kt +Kotlin +*S Kotlin +*F ++ 1 1.kt +test/_1Kt$inlineFun$1 +*L +1#1,12:1 +*E + +// FILE: 2.smap + +SMAP +2.kt +Kotlin +*S Kotlin +*F ++ 1 2.kt +_2Kt ++ 2 1.kt +test/_1Kt +*L +1#1,9:1 +6#2,2:10 +*E +*S KotlinDebug +*F ++ 1 2.kt +_2Kt +*L +6#1,2:10 +*E + +SMAP +1.kt +Kotlin +*S Kotlin +*F ++ 1 1.kt +test/_1Kt$inlineFun$2 ++ 2 1.kt +test/_1Kt$inlineFun$1 +*L +1#1,12:1 +6#2:13 +*E \ No newline at end of file diff --git a/backend.native/tests/external/codegen/boxInline/smap/defaultLambda/simple.kt b/backend.native/tests/external/codegen/boxInline/smap/defaultLambda/simple.kt new file mode 100644 index 00000000000..cc11d7cb7b2 --- /dev/null +++ b/backend.native/tests/external/codegen/boxInline/smap/defaultLambda/simple.kt @@ -0,0 +1,64 @@ +// FILE: 1.kt +// LANGUAGE_VERSION: 1.2 +// SKIP_INLINE_CHECK_IN: inlineFun$default +package test + +inline fun inlineFun(capturedParam: String, lambda: () -> String = { capturedParam }): String { + return lambda() +} + +// FILE: 2.kt + +import test.* + +fun box(): String { + return inlineFun("OK") +} + +// FILE: 1.smap +//TODO maybe do smth with default method body mapping +SMAP +1.kt +Kotlin +*S Kotlin +*F ++ 1 1.kt +test/_1Kt +*L +1#1,10:1 +7#1:11 +*E + +SMAP +1.kt +Kotlin +*S Kotlin +*F ++ 1 1.kt +test/_1Kt$inlineFun$1 +*L +1#1,10:1 +*E + +// FILE: 2.smap + +SMAP +2.kt +Kotlin +*S Kotlin +*F ++ 1 2.kt +_2Kt ++ 2 1.kt +test/_1Kt +*L +1#1,9:1 +6#2,2:10 +*E +*S KotlinDebug +*F ++ 1 2.kt +_2Kt +*L +6#1,2:10 +*E \ No newline at end of file diff --git a/backend.native/tests/external/compileKotlinAgainstKotlin/jvmPackageName.kt b/backend.native/tests/external/compileKotlinAgainstKotlin/jvmPackageName.kt new file mode 100644 index 00000000000..8a351766474 --- /dev/null +++ b/backend.native/tests/external/compileKotlinAgainstKotlin/jvmPackageName.kt @@ -0,0 +1,26 @@ +// IGNORE_BACKEND: NATIVE +// FILE: A.kt +// LANGUAGE_VERSION: 1.2 + +@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") +@file:JvmPackageName("bar") +package foo + +fun f() = "OK" + +var v: Int = 1 + +inline fun i(block: () -> Unit) = block() + +// FILE: B.kt +// LANGUAGE_VERSION: 1.2 + +import foo.* + +fun box(): String { + v = 2 + if (v != 2) return "Fail" + i { v = 3 } + if (v != 3) return "Fail" + return f() +} diff --git a/backend.native/tests/external/compileKotlinAgainstKotlin/jvmPackageNameInRootPackage.kt b/backend.native/tests/external/compileKotlinAgainstKotlin/jvmPackageNameInRootPackage.kt new file mode 100644 index 00000000000..65d9f3365ab --- /dev/null +++ b/backend.native/tests/external/compileKotlinAgainstKotlin/jvmPackageNameInRootPackage.kt @@ -0,0 +1,19 @@ +// IGNORE_BACKEND: NATIVE +// FILE: A.kt +// LANGUAGE_VERSION: 1.2 + +@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") +@file:JvmPackageName("bar") + +fun f() = "OK" + +var v: Int = 1 + +// FILE: B.kt +// LANGUAGE_VERSION: 1.2 + +fun box(): String { + v = 2 + if (v != 2) return "Fail" + return f() +} diff --git a/backend.native/tests/external/compileKotlinAgainstKotlin/jvmPackageNameWithJvmName.kt b/backend.native/tests/external/compileKotlinAgainstKotlin/jvmPackageNameWithJvmName.kt new file mode 100644 index 00000000000..d5aa6ce0906 --- /dev/null +++ b/backend.native/tests/external/compileKotlinAgainstKotlin/jvmPackageNameWithJvmName.kt @@ -0,0 +1,23 @@ +// IGNORE_BACKEND: NATIVE +// FILE: A.kt +// LANGUAGE_VERSION: 1.2 + +@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") +@file:JvmPackageName("bar") +@file:JvmName("Baz") +package foo + +fun f() = "OK" + +var v: Int = 1 + +// FILE: B.kt +// LANGUAGE_VERSION: 1.2 + +import foo.* + +fun box(): String { + v = 2 + if (v != 2) return "Fail" + return f() +} diff --git a/backend.native/tests/external/compileKotlinAgainstKotlin/multifileClassWithTypealias.kt b/backend.native/tests/external/compileKotlinAgainstKotlin/multifileClassWithTypealias.kt new file mode 100644 index 00000000000..f7ed63a5c3f --- /dev/null +++ b/backend.native/tests/external/compileKotlinAgainstKotlin/multifileClassWithTypealias.kt @@ -0,0 +1,16 @@ +// IGNORE_BACKEND: NATIVE +// FILE: A.kt + +@file:[JvmName("Test") JvmMultifileClass] + +typealias S = String +typealias LS = List + +// FILE: B.kt + +import java.util.Arrays + +fun box(): S { + val l: LS = Arrays.asList("OK") + return l[0] +} diff --git a/backend.native/tests/external/compileKotlinAgainstKotlin/targetedJvmName.kt b/backend.native/tests/external/compileKotlinAgainstKotlin/targetedJvmName.kt new file mode 100644 index 00000000000..3ae0ab843ff --- /dev/null +++ b/backend.native/tests/external/compileKotlinAgainstKotlin/targetedJvmName.kt @@ -0,0 +1,15 @@ +// IGNORE_BACKEND: NATIVE +// FILE: A.kt +package lib + +@set:JvmName("renamedSetFoo") +@get:JvmName("renamedGetFoo") +var foo = "not set" + +// FILE: B.kt +import lib.* + +fun box(): String { + foo = "OK" + return foo +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index ccb738a8de7..3546e58c17f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,8 +18,8 @@ kotlin_version=1.1.4 llvmVersion = 3.9.0 remoteRoot=konan_tests #kotlinCompilerModule=org.jetbrains.kotlin:kotlin-compiler:1.1-SNAPSHOT -# Download artifacts of https://teamcity.jetbrains.com/viewType.html?buildTypeId=bt345 -testDataVersion=1067176:id +# Download artifacts of https://teamcity.jetbrains.com/viewType.html?buildTypeId=Kotlin_120_Compiler +testDataVersion=1213932:id kotlinCompilerRepo=https://dl.bintray.com/jetbrains/kotlin-native-dependencies #kotlinCompilerRepo=http://oss.sonatype.org/content/repositories/snapshots #kotlinCompilerRepo=http://dl.bintray.com/kotlin/kotlin-dev