Merge pull request #2545 from ermshiperete/Xamarin-24974
[mono.git] / mono / tests / verifier / valid_branch_to_first_intruction_of_try.il
1
2 // valid CIL which breaks the ECMA-335 rules. 
3 // this CIL should fail verification by a conforming CLI verifier.
4
5 .assembly 'valid_branch_inside_same_block_1_generated'
6 {
7   .hash algorithm 0x00008004
8   .ver  0:0:0:0
9 }
10
11 .class ClassA
12         extends [mscorlib]System.Object
13 {
14 }
15
16 .class sealed MyValueType
17         extends [mscorlib]System.ValueType
18 {
19         .field private int32 v
20 }
21
22 .class public Template`1<T>
23         extends [mscorlib]System.Object
24 {
25 }
26
27 .class sealed public ValueTypeTemplate`1<T>
28         extends [mscorlib]System.ValueType
29 {
30         .field private int32 v
31 }
32
33 .method public static int32 Main() cil managed
34 {
35         .entrypoint
36         .maxstack 8
37         .locals init (object _X0, int32 _X1)
38  
39         nop
40         nop
41         ldloc.1
42         brtrue BLOCK_1
43
44 BLOCK_1:
45         .try {
46                 nop
47                 newobj instance void class [mscorlib]System.Exception::.ctor()
48                 throw
49                 nop
50
51                 leave END
52         } catch [mscorlib]System.Exception {
53                 stloc.0
54                 leave END
55         }
56
57 END:
58         ldc.i4.0
59         ret
60 }