Warning, /frameworks/syntax-highlighting/autotests/folding/test.il.fold is written in an unsupported language. File is not indexed.

0001 // Test file for the Common Intermediate Language
0002 
0003 <beginfold id='1'>/*</beginfold id='1'>
0004   multi line comment
0005 <endfold id='1'>*/</endfold id='1'>
0006 
0007 // examples from Wikipedia
0008 .assembly Hello <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>
0009 .assembly extern mscorlib <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>
0010 .method static void Main()
0011 <beginfold id='2'>{</beginfold id='2'>
0012      .entrypoint
0013      .maxstack 1
0014      ldstr "Hello, world!"
0015      call void [mscorlib]System.Console::WriteLine(string)
0016      ret
0017 <endfold id='2'>}</endfold id='2'>
0018 
0019 .method private hidebysig static void Main(string[] args) cil managed
0020 <beginfold id='2'>{</beginfold id='2'>
0021     .entrypoint
0022     .maxstack  2
0023     .locals init (int32 V_0,
0024                   int32 V_1)
0025 
0026               ldc.i4.2
0027               stloc.0
0028               br.s       IL_001f
0029     IL_0004:  ldc.i4.2
0030               stloc.1
0031               br.s       IL_0011
0032     IL_0008:  ldloc.0
0033               ldloc.1
0034               rem
0035               brfalse.s  IL_001b
0036               ldloc.1
0037               ldc.i4.1
0038               add
0039               stloc.1
0040     IL_0011:  ldloc.1
0041               ldloc.0
0042               blt.s      IL_0008
0043               ldloc.0
0044               call       void [mscorlib]System.Console::WriteLine(int32)
0045     IL_001b:  ldloc.0
0046               ldc.i4.1
0047               add
0048               stloc.0
0049     IL_001f:  ldloc.0
0050               ldc.i4     0x3e8
0051               blt.s      IL_0004
0052               ret
0053 <endfold id='2'>}</endfold id='2'>
0054 
0055 .method assembly static void modopt([mscorlib]System.Runtime.CompilerServices.CallConvCdecl)
0056         test_pointer_operations(int32 param) cil managed
0057 <beginfold id='2'>{</beginfold id='2'>
0058   .vtentry 1 : 1
0059   // Code size       44 (0x2c)
0060   .maxstack  2
0061   .locals ([0] int32* ptr,
0062            [1] valuetype A* V_1,
0063            [2] valuetype A* a,
0064            [3] int32 k)
0065 // k = 0;
0066   IL_0000:  ldc.i4.0
0067   IL_0001:  stloc.3
0068 // ptr = &k;
0069   IL_0002:  ldloca.s   k // load local's address instruction
0070   IL_0004:  stloc.0
0071 // *ptr = 1;
0072   IL_0005:  ldloc.0
0073   IL_0006:  ldc.i4.1
0074   IL_0007:  stind.i4 // indirection instruction
0075 // ptr = &param
0076   IL_0008:  ldarga.s   param // load parameter's address instruction
0077   IL_000a:  stloc.0
0078 // *ptr = 2
0079   IL_000b:  ldloc.0
0080   IL_000c:  ldc.i4.2
0081   IL_000d:  stind.i4
0082 // a = new A;
0083   IL_000e:  ldloca.s   a
0084   IL_0010:  call       valuetype A* modopt([mscorlib]System.Runtime.CompilerServices.CallConvThiscall) 'A.<beginfold id='2'>{</beginfold id='2'>ctor<endfold id='2'>}</endfold id='2'>'(valuetype A* modopt([mscorlib]System.Runtime.CompilerServices.IsConst) modopt([mscorlib]System.Runtime.CompilerServices.IsConst))
0085   IL_0015:  pop
0086 // ptra = &a;
0087   IL_0016:  ldloca.s   a
0088   IL_0018:  stloc.1
0089 // ptra->meth();
0090   IL_0019:  ldloc.1
0091   IL_001a:  dup
0092   IL_001b:  ldind.i4 // reading the VMT for virtual call
0093   IL_001c:  ldind.i4
0094   IL_001d:  calli      unmanaged stdcall void modopt([mscorlib]System.Runtime.CompilerServices.CallConvStdcall)(native int)
0095   IL_0022:  ret
0096 <endfold id='2'>}</endfold id='2'> // end of method 'Global Functions'::test_pointer_operations