2007-10-09 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / tests / verifier / invalid_backward_branch.il
1 // Invalid CIL which breaks the ECMA-335,III,1.7.5 rule "Backward branch 
2 // constraints". This CIL should be rejected by a conforming CLI verifier 
3 // or runtime without being run.
4
5 .assembly 'test_generated'
6 {
7   .hash algorithm 0x00008004
8   .ver  0:0:0:0
9 }
10
11
12
13 .method public static int32 Main() cil managed
14 {
15         .entrypoint
16         .maxstack 2
17         br end
18         branch_target: // Follows unconditional branch, stack empty.
19         ldc.i4.0
20         br branch_target // Stack not empty, invalid.
21         end:
22         ldc.i4.0
23         pop
24         #the verifier can do DCE before performing stack merging
25         newobj instance void object::.ctor()
26         callvirt instance int32 object::GetHashCode()
27         beq.s branch_target
28         ldc.i4.0
29         ret
30 }