// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Runtime.CompilerServices; using Xunit; namespace SimpleArray_01 { public delegate void RngTest(); public class Class1 { [Fact] public static int TestEntryPoint() { int retVal = 100; int testNum = 0; RngTest[] Tests = { new RngTest(Test.Test1) }; foreach (RngTest test in Tests) { testNum++; if (DoTest(test)) { Console.WriteLine("Test {0} Passed", testNum); } else { Console.WriteLine("Test {0} Failed", testNum); retVal = 1; } } return retVal; } //Test shall throw IndexOutOfRangeException if rangecheck is inserted properly private static bool DoTest(RngTest Test) { bool bResult = false; try { Test(); } catch (System.IndexOutOfRangeException) { bResult = true; } catch (Exception e) { Console.WriteLine(e.Message); } return bResult; } } internal class Test { /******************************************************************************************** * Stress Test 2 *********************************************************************************************/ [MethodImplAttribute(MethodImplOptions.NoInlining)] public static void Test1() { int[] array = new int[101]; for (int index1 = 0; index1 < array.Length; index1++) { for (int index2 = 0; index2 < array.Length; index2++) { for (int index3 = 0; index3 < array.Length; index3++) { for (int index4 = 0; index4 < array.Length; index4++) { for (int index5 = 0; index5 < array.Length; index5++) { for (int index6 = 0; index6 < array.Length; index6++) { for (int index7 = 0; index7 < array.Length; index7++) { for (int index8 = 0; index8 < array.Length; index8++) { for (int index9 = 0; index9 < array.Length; index9++) { for (int index10 = 0; index10 < array.Length; index10++) { for (int index11 = 0; index11 < array.Length; index11++) { for (int index12 = 0; index12 < array.Length; index12++) { for (int index13 = 0; index13 < array.Length; index13++) { for (int index14 = 0; index14 < array.Length; index14++) { for (int index15 = 0; index15 < array.Length; index15++) { for (int index16 = 0; index16 < array.Length; index16++) { for (int index17 = 0; index17 < array.Length; index17++) { for (int index18 = 0; index18 < array.Length; index18++) { for (int index19 = 0; index19 < array.Length; index19++) { for (int index20 = 0; index20 < array.Length; index20++) { for (int index21 = 0; index21 < array.Length; index21++) { for (int index22 = 0; index22 < array.Length; index22++) { for (int index23 = 0; index23 < array.Length; index23++) { for (int index24 = 0; index24 < array.Length; index24++) { for (int index25 = 0; index25 < array.Length; index25++) { for (int index26 = 0; index26 < array.Length; index26++) { for (int index27 = 0; index27 < array.Length; index27++) { for (int index28 = 0; index28 < array.Length; index28++) { for (int index29 = 0; index29 < array.Length; index29++) { for (int index30 = 0; index30 < array.Length; index30++) { for (int index31 = 0; index31 < array.Length; index31++) { for (int index32 = 0; index32 < array.Length; index32++) { for (int index33 = 0; index33 < array.Length; index33++) { for (int index34 = 0; index34 < array.Length; index34++) { for (int index35 = 0; index35 < array.Length; index35++) { for (int index36 = 0; index36 < array.Length; index36++) { for (int index37 = 0; index37 < array.Length; index37++) { for (int index38 = 0; index38 < array.Length; index38++) { for (int index39 = 0; index39 < array.Length; index39++) { for (int index40 = 0; index40 < array.Length; index40++) { for (int index41 = 0; index41 < array.Length; index41++) { for (int index42 = 0; index42 < array.Length; index42++) { for (int index43 = 0; index43 < array.Length; index43++) { for (int index44 = 0; index44 < array.Length; index44++) { for (int index45 = 0; index45 < array.Length; index45++) { for (int index46 = 0; index46 < array.Length; index46++) { for (int index47 = 0; index47 < array.Length; index47++) { for (int index48 = 0; index48 < array.Length; index48++) { for (int index49 = 0; index49 < array.Length; index49++) { for (int index50 = 0; index50 < array.Length; index50++) { for (int index51 = 0; index51 < array.Length; index51++) { for (int index52 = 0; index52 < array.Length; index52++) { for (int index53 = 0; index53 < array.Length; index53++) { for (int index54 = 0; index54 < array.Length; index54++) { for (int index55 = 0; index55 < array.Length; index55++) { for (int index56 = 0; index56 < array.Length; index56++) { for (int index57 = 0; index57 < array.Length; index57++) { for (int index58 = 0; index58 < array.Length; index58++) { for (int index59 = 0; index59 < array.Length; index59++) { for (int index60 = 0; index60 < array.Length; index60++) { for (int index61 = 0; index61 < array.Length; index61++) { for (int index62 = 0; index62 < array.Length; index62++) { for (int index63 = 0; index63 < array.Length; index63++) { for (int index64 = 0; index64 < array.Length; index64++) { for (int index65 = 0; index65 < array.Length; index65++) { for (int index66 = 0; index66 < array.Length; index66++) { for (int index67 = 0; index67 < array.Length; index67++) { for (int index68 = 0; index68 < array.Length; index68++) { for (int index69 = 0; index69 < array.Length; index69++) { for (int index70 = 0; index70 < array.Length; index70++) { for (int index71 = 0; index71 < array.Length; index71++) { for (int index72 = 0; index72 < array.Length; index72++) { for (int index73 = 0; index73 < array.Length; index73++) { for (int index74 = 0; index74 < array.Length; index74++) { for (int index75 = 0; index75 < array.Length; index75++) { for (int index76 = 0; index76 < array.Length; index76++) { for (int index77 = 0; index77 < array.Length; index77++) { for (int index78 = 0; index78 < array.Length; index78++) { for (int index79 = 0; index79 < array.Length; index79++) { for (int index80 = 0; index80 < array.Length; index80++) { for (int index81 = 0; index81 < array.Length; index81++) { for (int index82 = 0; index82 < array.Length; index82++) { for (int index83 = 0; index83 < array.Length; index83++) { for (int index84 = 0; index84 < array.Length; index84++) { for (int index85 = 0; index85 < array.Length; index85++) { for (int index86 = 0; index86 < array.Length; index86++) { for (int index87 = 0; index87 < array.Length; index87++) { for (int index88 = 0; index88 < array.Length; index88++) { for (int index89 = 0; index89 < array.Length; index89++) { for (int index90 = 0; index90 < array.Length; index90++) { for (int index91 = 0; index91 < array.Length; index91++) { for (int index92 = 0; index92 < array.Length; index92++) { for (int index93 = 0; index93 < array.Length; index93++) { for (int index94 = 0; index94 < array.Length; index94++) { for (int index95 = 0; index95 < array.Length; index95++) { for (int index96 = 0; index96 < array.Length; index96++) { for (int index97 = 0; index97 < array.Length; index97++) { for (int index98 = 0; index98 < array.Length; index98++) { for (int index99 = 0; index99 < array.Length; index99++) { for (int index100 = 0; index100 < array.Length; index100++) { for (int index101 = 0; index101 < array.Length; index101++) { for (int index102 = 0; index102 < array.Length; index102++) { for (int index103 = 0; index103 < array.Length; index103++) { for (int index104 = 0; index104 < array.Length; index104++) { for (int index105 = 0; index105 < array.Length; index105++) { for (int index106 = 0; index106 < array.Length; index106++) { for (int index107 = 0; index107 < array.Length; index107++) { for (int index108 = 0; index108 < array.Length; index108++) { for (int index109 = 0; index109 < array.Length; index109++) { for (int index110 = 0; index110 < array.Length; index110++) { for (int index111 = 0; index111 < array.Length; index111++) { for (int index112 = 0; index112 < array.Length; index112++) { for (int index113 = 0; index113 < array.Length; index113++) { for (int index114 = 0; index114 < array.Length; index114++) { for (int index115 = 0; index115 < array.Length; index115++) { for (int index116 = 0; index116 < array.Length; index116++) { for (int index117 = 0; index117 < array.Length; index117++) { for (int index118 = 0; index118 < array.Length; index118++) { for (int index119 = 0; index119 < array.Length; index119++) { for (int index120 = 0; index120 < array.Length; index120++) { for (int index121 = 0; index121 < array.Length; index121++) { for (int index122 = 0; index122 < array.Length; index122++) { for (int index123 = 0; index123 < array.Length; index123++) { for (int index124 = 0; index124 < array.Length; index124++) { for (int index125 = 0; index125 < array.Length; index125++) { for (int index126 = 0; index126 < array.Length; index126++) { for (int index127 = 0; index127 < array.Length; index127++) { for (int index128 = 0; index128 < array.Length; index128++) { for (int index129 = 0; index129 < array.Length; index129++) { for (int index130 = 0; index130 < array.Length; index130++) { for (int index131 = 0; index131 < array.Length; index131++) { for (int index132 = 0; index132 < array.Length; index132++) { for (int index133 = 0; index133 < array.Length; index133++) { for (int index134 = 0; index134 < array.Length; index134++) { for (int index135 = 0; index135 < array.Length; index135++) { for (int index136 = 0; index136 < array.Length; index136++) { for (int index137 = 0; index137 < array.Length; index137++) { for (int index138 = 0; index138 < array.Length; index138++) { for (int index139 = 0; index139 < array.Length; index139++) { for (int index140 = 0; index140 < array.Length; index140++) { for (int index141 = 0; index141 < array.Length; index141++) { for (int index142 = 0; index142 < array.Length; index142++) { for (int index143 = 0; index143 < array.Length; index143++) { for (int index144 = 0; index144 < array.Length; index144++) { for (int index145 = 0; index145 < array.Length; index145++) { for (int index146 = 0; index146 < array.Length; index146++) { for (int index147 = 0; index147 < array.Length; index147++) { for (int index148 = 0; index148 < array.Length; index148++) { for (int index149 = 0; index149 < array.Length; index149++) { for (int index150 = 0; index150 < array.Length; index150++) { for (int index151 = 0; index151 < array.Length; index151++) { for (int index152 = 0; index152 < array.Length; index152++) { for (int index153 = 0; index153 < array.Length; index153++) { for (int index154 = 0; index154 < array.Length; index154++) { for (int index155 = 0; index155 < array.Length; index155++) { for (int index156 = 0; index156 < array.Length; index156++) { for (int index157 = 0; index157 < array.Length; index157++) { for (int index158 = 0; index158 < array.Length; index158++) { for (int index159 = 0; index159 < array.Length; index159++) { for (int index160 = 0; index160 < array.Length; index160++) { for (int index161 = 0; index161 < array.Length; index161++) { for (int index162 = 0; index162 < array.Length; index162++) { for (int index163 = 0; index163 < array.Length; index163++) { for (int index164 = 0; index164 < array.Length; index164++) { for (int index165 = 0; index165 < array.Length; index165++) { for (int index166 = 0; index166 < array.Length; index166++) { for (int index167 = 0; index167 < array.Length; index167++) { for (int index168 = 0; index168 < array.Length; index168++) { for (int index169 = 0; index169 < array.Length; index169++) { for (int index170 = 0; index170 < array.Length; index170++) { for (int index171 = 0; index171 < array.Length; index171++) { for (int index172 = 0; index172 < array.Length; index172++) { for (int index173 = 0; index173 < array.Length; index173++) { for (int index174 = 0; index174 < array.Length; index174++) { for (int index175 = 0; index175 < array.Length; index175++) { for (int index176 = 0; index176 < array.Length; index176++) { for (int index177 = 0; index177 < array.Length; index177++) { for (int index178 = 0; index178 < array.Length; index178++) { for (int index179 = 0; index179 < array.Length; index179++) { for (int index180 = 0; index180 < array.Length; index180++) { for (int index181 = 0; index181 < array.Length; index181++) { for (int index182 = 0; index182 < array.Length; index182++) { for (int index183 = 0; index183 < array.Length; index183++) { for (int index184 = 0; index184 < array.Length; index184++) { for (int index185 = 0; index185 < array.Length; index185++) { for (int index186 = 0; index186 < array.Length; index186++) { for (int index187 = 0; index187 < array.Length; index187++) { for (int index188 = 0; index188 < array.Length; index188++) { for (int index189 = 0; index189 < array.Length; index189++) { for (int index190 = 0; index190 < array.Length; index190++) { for (int index191 = 0; index191 < array.Length; index191++) { for (int index192 = 0; index192 < array.Length; index192++) { array[++index1] = index1; array[++index2] = index2; array[++index3] = index3; array[++index4] = index4; array[++index5] = index5; array[++index6] = index6; array[++index7] = index7; array[++index8] = index8; array[++index9] = index9; array[++index10] = index10; array[++index11] = index11; array[++index12] = index12; array[++index13] = index13; array[++index14] = index14; array[++index15] = index15; array[++index16] = index16; array[++index17] = index17; array[++index18] = index18; array[++index19] = index19; array[++index20] = index20; array[++index21] = index21; array[++index22] = index22; array[++index23] = index23; array[++index24] = index24; array[++index25] = index25; array[++index26] = index26; array[++index27] = index27; array[++index28] = index28; array[++index29] = index29; array[++index30] = index30; array[++index31] = index31; array[++index32] = index32; array[++index33] = index33; array[++index34] = index34; array[++index35] = index35; array[++index36] = index36; array[++index37] = index37; array[++index38] = index38; array[++index39] = index39; array[++index40] = index40; array[++index41] = index41; array[++index42] = index42; array[++index43] = index43; array[++index44] = index44; array[++index45] = index45; array[++index46] = index46; array[++index47] = index47; array[++index48] = index48; array[++index49] = index49; array[++index50] = index50; array[++index51] = index51; array[++index52] = index52; array[++index53] = index53; array[++index54] = index54; array[++index55] = index55; array[++index56] = index56; array[++index57] = index57; array[++index58] = index58; array[++index59] = index59; array[++index60] = index60; array[++index61] = index61; array[++index62] = index62; array[++index63] = index63; array[++index64] = index64; array[++index65] = index65; array[++index66] = index66; array[++index67] = index67; array[++index68] = index68; array[++index69] = index69; array[++index70] = index70; array[++index71] = index71; array[++index72] = index72; array[++index73] = index73; array[++index74] = index74; array[++index75] = index75; array[++index76] = index76; array[++index77] = index77; array[++index78] = index78; array[++index79] = index79; array[++index80] = index80; array[++index81] = index81; array[++index82] = index82; array[++index83] = index83; array[++index84] = index84; array[++index85] = index85; array[++index86] = index86; array[++index87] = index87; array[++index88] = index88; array[++index89] = index89; array[++index90] = index90; array[++index91] = index91; array[++index92] = index92; array[++index93] = index93; array[++index94] = index94; array[++index95] = index95; array[++index96] = index96; array[++index97] = index97; array[++index98] = index98; array[++index99] = index99; array[++index100] = index100; array[++index101] = index101; array[++index102] = index102; array[++index103] = index103; array[++index104] = index104; array[++index105] = index105; array[++index106] = index106; array[++index107] = index107; array[++index108] = index108; array[++index109] = index109; array[++index110] = index110; array[++index111] = index111; array[++index112] = index112; array[++index113] = index113; array[++index114] = index114; array[++index115] = index115; array[++index116] = index116; array[++index117] = index117; array[++index118] = index118; array[++index119] = index119; array[++index120] = index120; array[++index121] = index121; array[++index122] = index122; array[++index123] = index123; array[++index124] = index124; array[++index125] = index125; array[++index126] = index126; array[++index127] = index127; array[++index128] = index128; array[++index129] = index129; array[++index130] = index130; array[++index131] = index131; array[++index132] = index132; array[++index133] = index133; array[++index134] = index134; array[++index135] = index135; array[++index136] = index136; array[++index137] = index137; array[++index138] = index138; array[++index139] = index139; array[++index140] = index140; array[++index141] = index141; array[++index142] = index142; array[++index143] = index143; array[++index144] = index144; array[++index145] = index145; array[++index146] = index146; array[++index147] = index147; array[++index148] = index148; array[++index149] = index149; array[++index150] = index150; array[++index151] = index151; array[++index152] = index152; array[++index153] = index153; array[++index154] = index154; array[++index155] = index155; array[++index156] = index156; array[++index157] = index157; array[++index158] = index158; array[++index159] = index159; array[++index160] = index160; array[++index161] = index161; array[++index162] = index162; array[++index163] = index163; array[++index164] = index164; array[++index165] = index165; array[++index166] = index166; array[++index167] = index167; array[++index168] = index168; array[++index169] = index169; array[++index170] = index170; array[++index171] = index171; array[++index172] = index172; array[++index173] = index173; array[++index174] = index174; array[++index175] = index175; array[++index176] = index176; array[++index177] = index177; array[++index178] = index178; array[++index179] = index179; array[++index180] = index180; array[++index181] = index181; array[++index182] = index182; array[++index183] = index183; array[++index184] = index184; array[++index185] = index185; array[++index186] = index186; array[++index187] = index187; array[++index188] = index188; array[++index189] = index189; array[++index190] = index190; array[++index191] = index191; array[++index192] = index192; } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } }