2008-07-21 Marek Safar <marek.safar@gmail.com>
authorMarek Safar <marek.safar@gmail.com>
Mon, 21 Jul 2008 17:49:58 +0000 (17:49 -0000)
committerMarek Safar <marek.safar@gmail.com>
Mon, 21 Jul 2008 17:49:58 +0000 (17:49 -0000)
A test for bug #409045

svn path=/trunk/mcs/; revision=108393

mcs/tests/test-657-p2.cs [new file with mode: 0755]
mcs/tests/test-657.cs [new file with mode: 0755]

diff --git a/mcs/tests/test-657-p2.cs b/mcs/tests/test-657-p2.cs
new file mode 100755 (executable)
index 0000000..5bc8cf0
--- /dev/null
@@ -0,0 +1,16 @@
+#define DEBUG
+
+using System;
+
+namespace TestDebug
+{
+       class C
+       {
+               public static void Method ()
+               {
+#if !DEBUG
+                       throw new ApplicationException ("3");
+#endif
+               }
+       }
+}
diff --git a/mcs/tests/test-657.cs b/mcs/tests/test-657.cs
new file mode 100755 (executable)
index 0000000..aefc2f8
--- /dev/null
@@ -0,0 +1,27 @@
+// Compiler options: test-657-p2.cs -out:test-657.exe
+
+using System;
+using System.Diagnostics;
+
+namespace TestDebug
+{
+       class Program
+       {
+               [Conditional ("DEBUG")]
+               public static void Excluded ()
+               {
+                       throw new ApplicationException ("1");
+               }
+
+               static int Main ()
+               {
+                       C.Method (); // Only checks that DEBUG is defined in second file
+                       
+                       Excluded ();
+#if DEBUG
+                       throw new ApplicationException ("1");
+#endif
+                       return 0;
+               }
+       }
+}