Merge pull request #4998 from kumpera/fix_56684
[mono.git] / mcs / tests / gtest-214.cs
1 //
2 // Test to check that in the 2.x profile, we add the RuntimeCompatibilityAttribute
3 // if none is specified.  Bug 76364
4 //
5 using System;
6 using System.Reflection;
7 using System.Runtime.CompilerServices;
8
9 class X {
10         public static int Main ()
11         {
12                 object [] attrs = typeof (X).Assembly.GetCustomAttributes (true);
13
14                 foreach (object o in attrs){
15                         if (o is RuntimeCompatibilityAttribute){
16                                 RuntimeCompatibilityAttribute a = (RuntimeCompatibilityAttribute) o;
17
18                                 if (a.WrapNonExceptionThrows)
19                                         return 0;
20                         }
21                 }
22
23                 // failed, did not find the attribute
24                 return 1;
25         }
26 }