Merge pull request #5675 from mono/glib-debug-symbols
[mono.git] / mcs / tests / test-942.cs
1 using System;
2 using System.Reflection;
3 using System.Diagnostics;
4
5 namespace ConditionalAttributeTesting
6 {
7         class MainClass
8         {
9                 public static int Main ()
10                 {
11                         return HelloWorld ();
12                 }
13
14                 [Some ("Test")]
15                 public static int HelloWorld ()
16                 {
17                         var methodInfo = MethodBase.GetCurrentMethod ();
18                         SomeAttribute someAttribute = Attribute.GetCustomAttribute (methodInfo, typeof (SomeAttribute)) as SomeAttribute;
19                         if (someAttribute != null) {
20                                 return 1;
21                         }
22
23                         return 0;
24                 }
25         }
26
27         [AttributeUsage (AttributeTargets.All)]
28         [Conditional ("NOT_DEFINED")]
29         public abstract class BaseAttribute : Attribute
30         {
31         }
32
33         public class SomeAttribute : BaseAttribute
34         {
35                 public SomeAttribute (string someText)
36                 {
37                 }
38         }
39 }