Migrating mbas test cases from mcs/btests to mcs/mbas/Test folder.
authorJambunathan K <jambunathan@mono-cvs.ximian.com>
Sun, 17 Oct 2004 09:50:50 +0000 (09:50 -0000)
committerJambunathan K <jambunathan@mono-cvs.ximian.com>
Sun, 17 Oct 2004 09:50:50 +0000 (09:50 -0000)
svn path=/trunk/mcs/; revision=35050

108 files changed:
mcs/mbas/Test/ChangeLog
mcs/mbas/Test/tests/InterfaceB.vb [new file with mode: 0755]
mcs/mbas/Test/tests/InterfaceC.vb [new file with mode: 0755]
mcs/mbas/Test/tests/InterfaceD.vb [new file with mode: 0755]
mcs/mbas/Test/tests/InterfaceE.vb [new file with mode: 0755]
mcs/mbas/Test/tests/InterfaceF.vb [new file with mode: 0755]
mcs/mbas/Test/tests/InterfaceG.vb [new file with mode: 0755]
mcs/mbas/Test/tests/InterfaceH.vb [new file with mode: 0755]
mcs/mbas/Test/tests/InvocationStatementA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/LabelA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/LabelB.vb [new file with mode: 0755]
mcs/mbas/Test/tests/LabelC.vb [new file with mode: 0755]
mcs/mbas/Test/tests/LabelD.vb [new file with mode: 0755]
mcs/mbas/Test/tests/LikeOperator.vb [new file with mode: 0755]
mcs/mbas/Test/tests/LikeOperatorA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/LineContinuationC1.vb [new file with mode: 0755]
mcs/mbas/Test/tests/LiteralNothing.vb [new file with mode: 0755]
mcs/mbas/Test/tests/LocalDeclarationA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/LocalVariablesA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/LocalVariablesB.vb [new file with mode: 0755]
mcs/mbas/Test/tests/LogicalOperators.vb [new file with mode: 0755]
mcs/mbas/Test/tests/LogicalOperatorsA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/LongLiteralA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/LongLiteralB.vb [new file with mode: 0755]
mcs/mbas/Test/tests/LongTypeCharTest.vb [new file with mode: 0644]
mcs/mbas/Test/tests/LongTypeCharTestB.vb [new file with mode: 0755]
mcs/mbas/Test/tests/LongTypeCharTestC2.vb [new file with mode: 0755]
mcs/mbas/Test/tests/LoopStatementsA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/ModuleB.vb [new file with mode: 0755]
mcs/mbas/Test/tests/ModuleTest.vb [new file with mode: 0755]
mcs/mbas/Test/tests/MustInherit.vb [new file with mode: 0755]
mcs/mbas/Test/tests/MustInheritA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/NameSpace.vb [new file with mode: 0755]
mcs/mbas/Test/tests/NameSpaceC.vb [new file with mode: 0755]
mcs/mbas/Test/tests/NotInheritable.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgFunction1.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgu_ByRefFuncA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgu_ByRefFuncB.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgu_ByRefFuncC.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgu_ByRefFuncD.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgu_ByReferenceA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgu_ByReferenceB.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgu_ByReferenceC.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgu_ByReferenceD.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgu_ByValFuncA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgu_ByValFuncB.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgu_ByValFuncC.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgu_ByValFuncD.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgu_ByValFuncE.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgu_ByValueA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgu_ByValueB.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgu_ByValueC.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgu_ByValueD.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgu_ByValueE.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OptionalArgument1.vb [new file with mode: 0755]
mcs/mbas/Test/tests/Overloading.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OverloadingA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OverrideA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/OverrideB.vb [new file with mode: 0755]
mcs/mbas/Test/tests/Override_exe.vb [new file with mode: 0644]
mcs/mbas/Test/tests/ParamArrayA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/ParamArrayB.vb [new file with mode: 0755]
mcs/mbas/Test/tests/PropertyA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/PropertyB.vb [new file with mode: 0755]
mcs/mbas/Test/tests/PropertyC.vb [new file with mode: 0755]
mcs/mbas/Test/tests/PropertyD.vb [new file with mode: 0755]
mcs/mbas/Test/tests/QualifiedNames.vb [new file with mode: 0755]
mcs/mbas/Test/tests/RegionDirectives.vb [new file with mode: 0755]
mcs/mbas/Test/tests/RegionDirectivesA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/RelationalOperators.vb [new file with mode: 0755]
mcs/mbas/Test/tests/RelationalOperatorsA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/Scope.vb [new file with mode: 0755]
mcs/mbas/Test/tests/ScopeA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/ShadowsA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/ShadowsC.vb [new file with mode: 0755]
mcs/mbas/Test/tests/ShadowsC4.vb [new file with mode: 0755]
mcs/mbas/Test/tests/ShadowsD.vb [new file with mode: 0755]
mcs/mbas/Test/tests/ShiftOperators.vb [new file with mode: 0755]
mcs/mbas/Test/tests/ShiftOperatorsA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/SingleLiteral.vb [new file with mode: 0755]
mcs/mbas/Test/tests/SingleLiteralA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/SingleLiteralB.vb [new file with mode: 0755]
mcs/mbas/Test/tests/SingleTypeCharTest.vb [new file with mode: 0644]
mcs/mbas/Test/tests/SingleTypeCharTestA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/SingleTypeCharTestB.vb [new file with mode: 0644]
mcs/mbas/Test/tests/SingleTypeCharTestC2.vb [new file with mode: 0755]
mcs/mbas/Test/tests/StringLiteralTest.vb [new file with mode: 0755]
mcs/mbas/Test/tests/StringLiterals.vb [new file with mode: 0755]
mcs/mbas/Test/tests/StringLiteralsA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/StringTypeCharTest.vb [new file with mode: 0644]
mcs/mbas/Test/tests/StringTypeCharTestA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/StringTypeCharTestB.vb [new file with mode: 0644]
mcs/mbas/Test/tests/StringTypeCharTestC2.vb [new file with mode: 0755]
mcs/mbas/Test/tests/StructureA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/StructureB.vb [new file with mode: 0755]
mcs/mbas/Test/tests/Test2.vb [new file with mode: 0755]
mcs/mbas/Test/tests/TypeOf.vb [new file with mode: 0755]
mcs/mbas/Test/tests/Variables.vb [new file with mode: 0755]
mcs/mbas/Test/tests/VariablesA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/VariablesB.vb [new file with mode: 0755]
mcs/mbas/Test/tests/VariablesC.vb [new file with mode: 0755]
mcs/mbas/Test/tests/VariablesD.vb [new file with mode: 0755]
mcs/mbas/Test/tests/VariablesE.vb [new file with mode: 0755]
mcs/mbas/Test/tests/WithStatementA.vb [new file with mode: 0755]
mcs/mbas/Test/tests/WithStatementB.vb [new file with mode: 0755]
mcs/mbas/Test/tests/WithStatementC.vb [new file with mode: 0755]
mcs/mbas/Test/tests/misc2.vb [new file with mode: 0755]

index dd7dd00b9563b55e0579501193c2e8e81df76e56..963f3c04b91f57f80bd45c090ade1b4d34944abe 100644 (file)
@@ -1,3 +1,7 @@
+2004-10-18  Jambunathan K  <kjambunathan@novell.com>
+       * Migrating mbas test cases from mcs/btests to mcs/mbas/Test
+       folder.
+
 2004-10-15  Jambunathan K  <kjambunathan@novell.com>
        * Audited existing negative test cases that emit multiple,
        mutually independent error messages and splitted them in to
diff --git a/mcs/mbas/Test/tests/InterfaceB.vb b/mcs/mbas/Test/tests/InterfaceB.vb
new file mode 100755 (executable)
index 0000000..339c04b
--- /dev/null
@@ -0,0 +1,29 @@
+Interface ILeft
+    Sub F()
+End Interface
+
+Interface IRight
+    Sub F()
+End Interface
+
+Interface ILeftRight
+    Inherits ILeft, IRight
+End Interface
+
+Class LeftRight
+    Implements ILeftRight
+
+    Sub LeftF() Implements ILeft.F
+    End Sub
+
+    Sub RightF() Implements IRight.F
+    End Sub
+End Class
+\r
+Module InterfaceB\r
+    Sub main()\r
+        Dim lr As New LeftRight()\r
+        lr.LeftF()\r
+        lr.RightF()\r
+    End Sub\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/InterfaceC.vb b/mcs/mbas/Test/tests/InterfaceC.vb
new file mode 100755 (executable)
index 0000000..80c9e48
--- /dev/null
@@ -0,0 +1,66 @@
+\r
+Interface I\r
+    Function F()\r
+End Interface\r
+\r
+\r
+Interface I1\r
+    Sub S()\r
+End Interface\r
+\r
+\r
+MustInherit Class C1\r
+    Implements I\r
+\r
+    Function F() Implements I.F\r
+    End Function\r
+End Class\r
+\r
+MustInherit Class C2\r
+    Implements I\r
+\r
+    MustOverride Function F() Implements I.F\r
+End Class\r
+\r
+\r
+MustInherit Class C3\r
+    Implements I1\r
+\r
+    MustOverride Sub S() Implements I1.S\r
+End Class\r
+\r
+\r
+Class DC1\r
+    Inherits C1\r
+End Class\r
+\r
+Class DC2\r
+    Inherits C2\r
+\r
+    Overrides Function F()\r
+    End Function\r
+End Class\r
+\r
+\r
+Class DC3\r
+    Inherits C3\r
+\r
+    Overrides Sub S()\r
+    End Sub\r
+End Class\r
+\r
+\r
+Module InterfaceC\r
+    Sub Main()\r
+        Dim x As DC1 = New DC1()\r
+        x.F()\r
+\r
+        Dim y As DC2 = New DC2()\r
+        y.F()\r
+\r
+\r
+        Dim z As DC3 = New DC3()\r
+        z.S()\r
+    End Sub\r
+End Module\r
+\r
diff --git a/mcs/mbas/Test/tests/InterfaceD.vb b/mcs/mbas/Test/tests/InterfaceD.vb
new file mode 100755 (executable)
index 0000000..7f058a8
--- /dev/null
@@ -0,0 +1,18 @@
+Interface I\r
+    Function F1(ByVal i As Integer)\r
+    Function F2(ByVal i As Integer)\r
+End Interface\r
+\r
+Class C\r
+    Implements I\r
+\r
+    Function F(ByVal i As Integer) Implements I.F1, I.F2\r
+    End Function\r
+End Class\r
+\r
+Module InterfaceD\r
+    Sub Main()\r
+        Dim x As C = New C()\r
+        x.F(10)\r
+    End Sub\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/InterfaceE.vb b/mcs/mbas/Test/tests/InterfaceE.vb
new file mode 100755 (executable)
index 0000000..ef60fcb
--- /dev/null
@@ -0,0 +1,30 @@
+Interface I\r
+    Function F1(ByVal i As Integer)\r
+    Function F2(ByVal i As Integer)\r
+End Interface\r
+\r
+Class B\r
+    Implements I\r
+\r
+    Overridable Function CF1(ByVal i As Integer) Implements I.F1\r
+    End Function\r
+\r
+    Overridable Function CF2(ByVal i As Integer) Implements I.F2\r
+    End Function\r
+End Class\r
+\r
+Class D\r
+    Inherits B\r
+    Overrides Function CF2(ByVal i As Integer)\r
+    End Function\r
+End Class\r
+\r
+Module InterfaceE\r
+    Sub Main()\r
+        Dim x As D = New D()\r
+        x.CF1(10)\r
+        x.CF2(10)\r
+    End Sub\r
+End Module\r
+\r
+\r
diff --git a/mcs/mbas/Test/tests/InterfaceF.vb b/mcs/mbas/Test/tests/InterfaceF.vb
new file mode 100755 (executable)
index 0000000..e5d84a4
--- /dev/null
@@ -0,0 +1,21 @@
+Interface I\r
+    Sub F1(ByVal i As Integer)\r
+    Sub F2(ByVal i As Integer)\r
+End Interface\r
+\r
+Class C1\r
+    Implements I\r
+\r
+    Public Sub F1(ByVal i As Integer) Implements I.F1\r
+    End Sub\r
+    Public Sub F2(ByVal i As Integer) Implements I.F2\r
+    End Sub\r
+End Class\r
+\r
+Module InterfaceD\r
+    Sub Main()\r
+        Dim myC As C1 = New C1()\r
+       myC.F1(10)\r
+       myC.F2(20)\r
+    End Sub\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/InterfaceG.vb b/mcs/mbas/Test/tests/InterfaceG.vb
new file mode 100755 (executable)
index 0000000..d7e902e
--- /dev/null
@@ -0,0 +1,18 @@
+Imports System
+
+Interface I
+       Sub F1()
+       Sub F2()
+End Interface
+
+Class C1
+   Implements I
+       Public Sub F() Implements I.F1,I.F2
+       End Sub
+End Class
+
+Module InterfaceG
+       Sub Main()
+               Dim C As New C1()
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/InterfaceH.vb b/mcs/mbas/Test/tests/InterfaceH.vb
new file mode 100755 (executable)
index 0000000..6fe9fe4
--- /dev/null
@@ -0,0 +1,49 @@
+' In this test all implemented
+' member names are different from 
+' the interface member names
+
+Delegate Sub d()
+
+Interface I\r
+    Function F()
+    Sub S (i as integer)
+    Property P
+    Event e (i as integer)
+    Event e1 as d\r
+End Interface\r
+\r
+Class C\r
+    Implements I\r
+\r
+    Function CF() Implements I.F\r
+    End Function
+
+   Sub CS(i as integer) Implements I.S\r
+   End Sub\r
+
+   Sub S1(i as integer)\r
+   End Sub\r
+
+
+   Property CP Implements I.P
+       Get
+       End Get
+       Set
+       End Set
+  End Property
+
+  Event Ce(i as integer) Implements I.e
+
+  Event Ce1 as d implements I.e1
+   \r
+End Class\r
+\r
+Module InterfaceA\r
+    Sub Main()\r
+        Dim x As C = New C()\r
+        x.CF()\r
+\r
+        Dim y As I = New C()\r
+        y.F()\r
+    End Sub\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/InvocationStatementA.vb b/mcs/mbas/Test/tests/InvocationStatementA.vb
new file mode 100755 (executable)
index 0000000..8b0115c
--- /dev/null
@@ -0,0 +1,65 @@
+Imports Microsoft.VisualBasic\r
+Imports System\r
+\r
+Module InvocationStatementA\r
+    Dim i As Integer = 0\r
+\r
+    Delegate Function Df(ByVal a As Integer)\r
+\r
+    Sub f1()\r
+        i += 1\r
+        f2()\r
+    End Sub\r
+\r
+    Function f2() As Integer\r
+        i += 2\r
+    End Function\r
+\r
+    Function f2(ByVal i As Integer) As Integer\r
+        i += 5\r
+        Return i\r
+    End Function\r
+\r
+    Function f2(ByVal o As Object) As Boolean\r
+        Return True\r
+    End Function\r
+\r
+    Function f3(ByVal j As Integer)\r
+        i += j\r
+    End Function\r
+\r
+    Function f4(ByVal j As Integer)\r
+        i += j * 10\r
+    End Function\r
+\r
+    Sub main()\r
+\r
+        Call f1()\r
+        If i <> 3 Then\r
+            Throw New Exception("#ISB1 - Invocation Statement failed")\r
+        End If\r
+\r
+        If f2(i) <> 8 Then\r
+            Throw New Exception("#ISB2 - Invocation Statement failed")\r
+        End If\r
+\r
+        If Not f2("Hello") Then\r
+            Throw New Exception("#ISB3 - Invocation Statement failed")\r
+        End If\r
+\r
+        If Not f2(2.3D) Then\r
+            Throw New Exception("#ISB4 - Invocation Statement failed")\r
+        End If\r
+\r
+        Dim d1, d2 As Df\r
+        d1 = New Df(AddressOf f3)\r
+        d2 = New Df(AddressOf f4)\r
+\r
+        d1.Invoke(2) : d2.Invoke(2)\r
+        If i <> 25 Then\r
+            Throw New Exception("#ISB5 - Invocation Statement failed")\r
+        End If\r
+\r
+    End Sub\r
+\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/LabelA.vb b/mcs/mbas/Test/tests/LabelA.vb
new file mode 100755 (executable)
index 0000000..4f6034c
--- /dev/null
@@ -0,0 +1,42 @@
+' Positive Test
+' Test labels in functions
+' the prduction for LabelName is
+' LabelName ::= Identifier | IntLiteral
+' vide vbls71 section 10.1 Blocks
+Imports System
+
+Module labelA
+
+
+    Function Abs(ByVal x As Integer) As Integer
+
+        If x >= 0 Then
+            GoTo 1234234
+        End If
+
+        x = -x
+
+1234234:
+        Return x
+
+    End Function
+
+
+    Sub Main()
+
+        Dim x As Integer, y As Integer
+        x = Abs(-1)
+
+        y = Abs(1)
+
+        If x <> 1 Then
+            Throw New Exception("#Lbl1")
+        End If
+        If y <> 1 Then
+            Throw New Exception("#Lbl2")
+        End If
+
+    End Sub
+
+
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/LabelB.vb b/mcs/mbas/Test/tests/LabelB.vb
new file mode 100755 (executable)
index 0000000..bebd829
--- /dev/null
@@ -0,0 +1,36 @@
+' Positive Test
+' Test labels in functions
+Imports System
+
+Module labelB
+
+
+    Function Abs(ByVal x As Integer) As Integer
+
+        If x >= 0 Then
+            GoTo x
+        End If
+
+        x = -x
+x:      Return x
+
+    End Function
+
+
+    Sub Main()
+        Dim x As Integer, y As Integer
+        x = Abs(-1)
+        y = Abs(1)
+
+        If x <> 1 Then
+            Throw New Exception("#Lbl1")
+        End If
+        If y <> 1 Then
+            Throw New Exception("#Lbl2")
+        End If
+
+
+    End Sub
+
+
+End Module
diff --git a/mcs/mbas/Test/tests/LabelC.vb b/mcs/mbas/Test/tests/LabelC.vb
new file mode 100755 (executable)
index 0000000..91c6981
--- /dev/null
@@ -0,0 +1,40 @@
+' Positive Test
+' Test labels in functions
+Imports System
+
+Module labelC
+
+
+    Function Abs(ByVal x As Integer) As Integer
+
+        If x >= 0 Then
+            GoTo x
+        End If
+
+        x = -x
+
+x:
+y:
+z:
+        Return x
+
+    End Function
+
+
+    Sub Main()
+        Dim x As Integer, y As Integer
+        x = Abs(-1)
+        y = Abs(1)
+
+        If x <> 1 Then
+            Throw New Exception("#Lbl1")
+        End If
+        If y <> 1 Then
+            Throw New Exception("#Lbl2")
+        End If
+
+
+    End Sub
+
+
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/LabelD.vb b/mcs/mbas/Test/tests/LabelD.vb
new file mode 100755 (executable)
index 0000000..3bc0efc
--- /dev/null
@@ -0,0 +1,58 @@
+' Positive Test
+' Test labels in functions
+''''''''''''''''''''''''''''''''''
+' vbc output
+''''''''''''''''''''''''''''''''''
+' Should be
+'Error BC30451: Name 'y' is not declared
+'Error BC30451: Name 'z' is not declared
+''''''''''''''''''''''''''''''''''''''''
+' mbas output
+''''''''''''''''''''''''''''''''''''''''''
+' syntax error, got token `IDENTIFIER', expecting EOL COLON
+'flabel.vb(21,0) error BC29999: Line:     21 Col: 0
+'VirtLine: 21 Token: 471
+'Parsing error in flabel.vb
+'Mono.MonoBASIC.yyParser.yyException: irrecoverable syntax error
+'in <0x0081e> Mono.MonoBASIC.Parser:yyparse (Mono.MonoBASIC.yyParser.yyInput)
+'in <0x002b0> Mono.MonoBASIC.Parser:parse ()
+''''''''''''''''''''''''''''''''''''''''''''''
+Imports System
+
+Module labelD
+
+
+
+    Function Abs1() As Integer
+
+        Dim x As Integer
+        x = 1
+        If x >= 0 Then
+            GoTo x
+        End If
+
+        x = -x
+
+x:
+y:
+z:
+        Return x
+
+    End Function
+
+    Sub Main()
+        Dim x As Integer, y As Integer
+
+        x = Abs1()
+        y = Abs1()
+
+        If x <> 1 Then
+            Throw New Exception("#Lbl3")
+        End If
+        If y <> 1 Then
+            Throw New Exception("#Lbl4")
+        End If
+    End Sub
+
+
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/LikeOperator.vb b/mcs/mbas/Test/tests/LikeOperator.vb
new file mode 100755 (executable)
index 0000000..9e4f177
--- /dev/null
@@ -0,0 +1,66 @@
+Imports System\r
+\r
+Module LikeOperator\r
+    Sub main()\r
+\r
+        Dim a As Boolean\r
+\r
+        a = "HELLO" Like "HELLO"\r
+        If a <> True Then\r
+            Console.WriteLine("#A1-LikeOperator:Failed")\r
+        End If\r
+\r
+        a = "HELLO" Like "HEllO"\r
+        If a <> False Then\r
+            Console.WriteLine("#A2-LikeOperator:Failed")\r
+        End If\r
+\r
+        a = "HELLO" Like "H*O"\r
+        If a <> True Then\r
+            Console.WriteLine("#A3-LikeOperator:Failed")\r
+        End If\r
+\r
+        a = "HELLO" Like "H[A-Z][!M-P][!A-K]O"\r
+        If a <> True Then\r
+            Console.WriteLine("#A4-LikeOperator:Failed")\r
+        End If\r
+\r
+        a = "HE12O" Like "H?##[L-P]"\r
+        If a <> True Then\r
+            Console.WriteLine("#A5-LikeOperator:Failed")\r
+        End If\r
+\r
+        a = "HELLO123WORLD" Like "H?*#*"\r
+        If a <> True Then\r
+            Console.WriteLine("#A6-LikeOperator:Failed")\r
+        End If\r
+\r
+        a = "HELLOworld" Like "B*O*d"\r
+        If a <> False Then\r
+            Console.WriteLine("#A7-LikeOperator:Failed")\r
+        End If\r
+\r
+        a = "" Like ""\r
+        If a <> True Then\r
+            Console.WriteLine("#A8-LikeOperator:Failed")\r
+        End If\r
+\r
+        a = "A" Like ""\r
+        If a <> False Then\r
+            Console.WriteLine("#A9-LikeOperator:Failed")\r
+        End If\r
+\r
+        a = "" Like "A"\r
+        If a <> False Then\r
+            Console.WriteLine("#A10-LikeOperator:Failed")\r
+        End If\r
+\r
+        a = "HELLO" Like "HELLO" & Nothing\r
+        If a <> True Then\r
+            Console.WriteLine("#A11-LikeOperator:Failed")\r
+        End If\r
+\r
+\r
+    End Sub\r
+\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/LikeOperatorA.vb b/mcs/mbas/Test/tests/LikeOperatorA.vb
new file mode 100755 (executable)
index 0000000..6653047
--- /dev/null
@@ -0,0 +1,42 @@
+Option Compare Text\r
+\r
+Imports System\r
+\r
+Module LikeOperatorA\r
+    Sub main()\r
+\r
+        Dim a As Boolean\r
+\r
+        a = "HEllo" Like "H[A-Z][!M-P][!A-K]O"\r
+        If a <> True Then\r
+            Console.WriteLine("#A1-LikeOperator:Failed")\r
+        End If\r
+\r
+        a = "he12O" Like "H?##[L-P]"\r
+        If a <> True Then\r
+            Console.WriteLine("#A2-LikeOperator:Failed")\r
+        End If\r
+\r
+        a = "He[ll?o*" Like "He[[]*[?]o[*]"\r
+        If a <> True Then\r
+            Console.WriteLine("#A3-LikeOperator:Failed")\r
+        End If\r
+\r
+        a = "Hell[]o*" Like "Hell[[][]]o[*]"\r
+        If a <> True Then\r
+            Console.WriteLine("#A4-LikeOperator:Failed")\r
+        End If\r
+\r
+        a = "Hell[]o*" Like "Hell[[]][[]]o[*]"\r
+        If a <> False Then\r
+            Console.WriteLine("#A5-LikeOperator:Failed")\r
+        End If\r
+\r
+        a = "Hello*" Like "Hell[]o[*]"\r
+        If a <> True Then\r
+            Console.WriteLine("#A6-LikeOperator:Failed")\r
+        End If\r
+\r
+    End Sub\r
+\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/LineContinuationC1.vb b/mcs/mbas/Test/tests/LineContinuationC1.vb
new file mode 100755 (executable)
index 0000000..0bfa27a
--- /dev/null
@@ -0,0 +1,11 @@
+Imports System
+
+Class As_
+End Class
+
+Module M
+       Sub Main()
+               Dim a As _
+                        As_
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/LiteralNothing.vb b/mcs/mbas/Test/tests/LiteralNothing.vb
new file mode 100755 (executable)
index 0000000..4b6fe0f
--- /dev/null
@@ -0,0 +1,6 @@
+Module LiteralNothing\r
+    Sub Main()\r
+        Dim x As Object\r
+        x = Nothing\r
+    End Sub\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/LocalDeclarationA.vb b/mcs/mbas/Test/tests/LocalDeclarationA.vb
new file mode 100755 (executable)
index 0000000..84c25fa
--- /dev/null
@@ -0,0 +1,39 @@
+Imports System\r
+\r
+Module LocalDeclarationA\r
+\r
+    Sub main()\r
+        Dim i, sum As Integer\r
+        For i = 0 To 4\r
+            sum = sum + f2()\r
+        Next\r
+        If sum <> 15 Then\r
+            Throw New Exception("#LD1: Static locals error")\r
+        End If\r
+    End Sub\r
+\r
+    Sub f1()\r
+\r
+        ' Various kinds of local decalations statements\r
+        Const a1 As Integer = 2\r
+        Static a2 As Double\r
+        Dim a3 As Integer ' Default value is initialized to 0 \r
+        Dim a4 As Boolean = True\r
+        Dim arr1() As Integer = {0, 1, 2, 3}\r
+        Dim arr2(,) As Integer = {{1, 2, 3}, {1 + 1, 1 + 2, 1 + 3}}\r
+        Dim arr3(10) As Integer ' An array of 11 integers indexed from 0 through 10\r
+        Dim arr4(2, 3, 4) As Date\r
+        Dim arr5() As Object\r
+        Dim b1, b2, b3, b4 As Integer\r
+        Dim c1 As Double, c2 As Boolean, c3 As DateTime\r
+        Dim d1 As New Date(2004, 8, 11)\r
+\r
+    End Sub\r
+\r
+    Function f2() As Integer\r
+        Static a As Integer\r
+        a = a + 1\r
+        Return a\r
+    End Function\r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/LocalVariablesA.vb b/mcs/mbas/Test/tests/LocalVariablesA.vb
new file mode 100755 (executable)
index 0000000..a45a1b5
--- /dev/null
@@ -0,0 +1,29 @@
+Imports System\r
+\r
+Module LocalVariablesA\r
+\r
+    Function swap(ByVal a As Integer, ByVal b As Integer) As Integer\r
+        Dim c As Integer\r
+        c = a\r
+        a = b\r
+        b = c\r
+        Return 0\r
+    End Function\r
+\r
+    ' Local variable having same name as Sub containing it\r
+    Sub f2()\r
+        Dim f2 As Integer = 1\r
+        f2 = f2 + 1\r
+        Console.WriteLine(f2)\r
+    End Sub\r
+\r
+    Sub main()\r
+        Dim a, b As Integer\r
+        a = 10 : b = 32\r
+        Console.WriteLine("a: {0}  b: {1}", a, b)\r
+        swap(a, b)\r
+        Console.WriteLine("a: {0}  b: {1}", a, b)\r
+        f2()\r
+    End Sub\r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/LocalVariablesB.vb b/mcs/mbas/Test/tests/LocalVariablesB.vb
new file mode 100755 (executable)
index 0000000..183998b
--- /dev/null
@@ -0,0 +1,38 @@
+' Testing implicitly declared local varable in funtion\r
+\r
+Imports System\r
+\r
+Module LocalVariablesB\r
+\r
+    Function f1(ByVal a As Integer, ByVal b As Integer) As Integer\r
+        f1 = a + b\r
+    End Function\r
+\r
+    Function f2(ByVal x As Integer)\r
+        f2 = x\r
+        If f2 = 0 Then\r
+            Return 0\r
+        Else\r
+            Return f2 + f2(f2 - 1)\r
+        End If\r
+\r
+    End Function\r
+\r
+\r
+    Sub main()\r
+\r
+        Dim a As Integer\r
+\r
+        a = f1(10, 12)\r
+        If a <> 22 Then\r
+            Throw New Exception("#LV1")\r
+        End If\r
+\r
+        a = f2(5)\r
+        If a <> 15 Then\r
+            Throw New Exception("#LV2")\r
+        End If\r
+\r
+    End Sub\r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/LogicalOperators.vb b/mcs/mbas/Test/tests/LogicalOperators.vb
new file mode 100755 (executable)
index 0000000..718cd9c
--- /dev/null
@@ -0,0 +1,89 @@
+' Logical Operators\r
+\r
+Imports System\r
+\r
+Module M\r
+\r
+    Sub Main()\r
+        Console.WriteLine(f())\r
+    End Sub\r
+\r
+    Function f1() As Boolean\r
+        Console.WriteLine("Function f1() is called")\r
+        Return True\r
+    End Function\r
+\r
+    Function f2() As Boolean\r
+        Console.WriteLine("Function f2() is called")\r
+        Return False\r
+    End Function\r
+\r
+    Function f() As Integer\r
+        Dim arr(35) As Boolean\r
+\r
+        Dim a1, a2, a3, a4 As Boolean\r
+        a1 = True : a2 = True : a3 = False : a4 = False\r
+\r
+        If a1 And a2 Then arr(0) = True\r
+        If a1 And a3 Then arr(1) = False Else arr(1) = True\r
+        If a3 And a1 Then arr(2) = False Else arr(2) = True\r
+        If a4 And a3 Then arr(3) = False Else arr(3) = True\r
+        If f1() And (a1 = True) Then arr(4) = True\r
+        If f2() And f1() Then arr(5) = False Else arr(5) = True\r
+\r
+        If a1 Or a2 Then arr(6) = True\r
+        If a1 Or a3 Then arr(7) = True\r
+        If a3 Or a1 Then arr(8) = True\r
+        If a4 Or a3 Then arr(9) = False Else arr(9) = True\r
+        If f1() Or (a1 = True) Then arr(10) = True\r
+        If f2() Or f1() Then arr(11) = True\r
+\r
+        If a1 Xor a2 Then arr(12) = False Else arr(12) = True\r
+        If a1 Xor a3 Then arr(13) = True\r
+        If a3 Xor a1 Then arr(14) = True\r
+        If a4 Xor a3 Then arr(15) = False Else arr(15) = True\r
+        If f1() Xor (a1 = True) Then arr(16) = False Else arr(16) = True\r
+        If f2() Xor f1() Then arr(17) = True\r
+\r
+        If f1() AndAlso f2() Then arr(18) = False Else arr(18) = True\r
+        If f2() AndAlso f1() Then arr(19) = False Else arr(19) = True\r
+        If f1() AndAlso (a1 = True) Then arr(20) = True\r
+\r
+        If f1() OrElse f2() Then arr(21) = True\r
+        If f2() OrElse f1() Then arr(22) = True\r
+        If (a1 = False) OrElse f2() Then arr(23) = False Else arr(23) = True\r
+\r
+        Dim b1 As Long = 2\r
+        Dim b2 As Byte = 5\r
+        \r
+        If (b1 And System.Int64.MaxValue) = b1 Then arr(24) = True\r
+        If (b1 And 0) = 0 Then arr(25) = True\r
+        If (b1 Or System.Int64.MaxValue) = System.Int64.MaxValue Then arr(26) = True\r
+        If (b1 Or 0) = b1 Then arr(27) = True\r
+        If (b1 Xor System.Int64.MaxValue) = (System.Int64.MaxValue - b1) Then arr(28) = True\r
+        If (b1 Xor 0) = b1 Then arr(29) = True\r
+\r
+        If (b2 And System.Byte.MaxValue) = b2 Then arr(30) = True\r
+        If (b2 And 0) = 0 Then arr(31) = True\r
+        If (b2 Or System.Byte.MaxValue) = System.Byte.MaxValue Then arr(32) = True\r
+        If (b2 Or 0) = b2 Then arr(33) = True\r
+        If (b2 Xor System.Byte.MaxValue) = (System.Byte.MaxValue - b2) Then arr(34) = True\r
+        If (b2 Xor 0) = b2 Then arr(35) = True\r
+\r
+        'Dim i As Integer\r
+        'For i = 0 To arr.GetUpperBound(0)\r
+        'Console.WriteLine("{0}: {1}", i, arr(i))\r
+        'Next\r
+\r
+        Dim bval As Boolean\r
+        For Each bval In arr\r
+            If Not bval Then\r
+                Return 1\r
+            End If\r
+        Next\r
+\r
+        Return 0\r
+\r
+    End Function\r
+\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/LogicalOperatorsA.vb b/mcs/mbas/Test/tests/LogicalOperatorsA.vb
new file mode 100755 (executable)
index 0000000..1e51cab
--- /dev/null
@@ -0,0 +1,21 @@
+\r
+Imports System\r
+\r
+Module LogicalOperatorsA\r
+\r
+    Sub Main()\r
+        Dim a1, a2 As Integer\r
+        a1 = f1() AndAlso f2()\r
+        a2 = a1 OrElse f1()\r
+        Console.WriteLine("{0}  {1}", a1, a2)\r
+    End Sub\r
+\r
+    Function f1() As Integer\r
+        Return 1\r
+    End Function\r
+\r
+    Function f2() As Boolean\r
+        Return False\r
+    End Function\r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/LongLiteralA.vb b/mcs/mbas/Test/tests/LongLiteralA.vb
new file mode 100755 (executable)
index 0000000..368ddfa
--- /dev/null
@@ -0,0 +1,23 @@
+Imports System
+Module LongLiteral
+       Sub Main()
+               Try
+                       Dim a As Long
+                       a=True
+                       If a<>-1 Then
+                               Console.WriteLine("#A1:LongLiteralA:Failed")
+                       End If
+               Catch e As Exception
+                       Console.WriteLine(e.Message)
+               End Try
+                Try
+                       Dim a As Long
+                       a=1.23
+                       If a<>1 Then
+                               Console.WriteLine("#A2:LongLiteralA:Failed")
+                       End If
+               Catch e As Exception
+                       Console.WriteLine(e.Message)
+               End Try
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/LongLiteralB.vb b/mcs/mbas/Test/tests/LongLiteralB.vb
new file mode 100755 (executable)
index 0000000..edb5f7b
--- /dev/null
@@ -0,0 +1,13 @@
+Imports System
+Module LongLiteral
+       Sub Main()
+       Try
+               Dim a As Long
+               If a<>0 Then
+                       Console.WriteLine("LongLiteralC:Failed-Default value assigned to long variable should be 0")
+               End If
+       Catch e As Exception
+               Console.WriteLine(e.Message)
+       End Try
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/LongTypeCharTest.vb b/mcs/mbas/Test/tests/LongTypeCharTest.vb
new file mode 100644 (file)
index 0000000..66b65f8
--- /dev/null
@@ -0,0 +1,19 @@
+Imports System
+Module LongTypeCharTest
+    Sub Main()
+        Try
+            Dim m As Long
+            m = f(20)
+            If m <> 20 Then
+                Throw New Exception("LongTypeCharTest: failed")
+            End If
+            Exit Sub
+        Catch e As Exception
+            Console.WriteLine(e.Message)
+        End Try
+    End Sub
+
+    Function f&(ByVal param%)
+        f = param
+    End Function
+End Module
diff --git a/mcs/mbas/Test/tests/LongTypeCharTestB.vb b/mcs/mbas/Test/tests/LongTypeCharTestB.vb
new file mode 100755 (executable)
index 0000000..b601df2
--- /dev/null
@@ -0,0 +1,19 @@
+Imports System\r
+Module LongTypeCharTest\r
+    Sub Main()\r
+        Try\r
+            Dim m As Long\r
+            m = f(20)\r
+            If m <> 20 Then\r
+                Throw New Exception("LongTypeCharTest: failed")\r
+            End If\r
+            Exit Sub\r
+        Catch e As Exception\r
+            Console.WriteLine(e.Message)\r
+        End Try\r
+    End Sub\r
+\r
+    Function f&(ByVal param%)\r
+        f& = param\r
+    End Function\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/LongTypeCharTestC2.vb b/mcs/mbas/Test/tests/LongTypeCharTestC2.vb
new file mode 100755 (executable)
index 0000000..3ff2fbf
--- /dev/null
@@ -0,0 +1,6 @@
+Module M
+       Sub Main()
+               Dim a&
+               a=23F
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/LoopStatementsA.vb b/mcs/mbas/Test/tests/LoopStatementsA.vb
new file mode 100755 (executable)
index 0000000..24d0bf4
--- /dev/null
@@ -0,0 +1,62 @@
+Imports System\r
+\r
+Module LoopStatementsA\r
+\r
+    Sub main()\r
+        Dim index As Integer = 0\r
+        Dim count As Integer = 0\r
+\r
+        Do\r
+            count += 1\r
+            index = 0\r
+            While index <> 4\r
+                index += 1\r
+            End While\r
+            If index <> 4 Then\r
+                Throw New Exception("#LSA1 - Loop Statement failed")\r
+            End If\r
+\r
+            Do While index < 10\r
+                index += 1\r
+                If index = 8 Then\r
+                    Exit Do\r
+                End If\r
+            Loop\r
+            If index <> 8 Then\r
+                Throw New Exception("#LSA2 - Loop Statement failed")\r
+            End If\r
+\r
+            Do\r
+                index += 1\r
+            Loop While index < 12\r
+            If index <> 12 Then\r
+                Throw New Exception("#LSA3 - Loop Statement failed")\r
+            End If\r
+\r
+            Do Until index <= 8\r
+                index -= 1\r
+            Loop\r
+            If index <> 8 Then\r
+                Throw New Exception("#LSA4 - Loop Statenment failed")\r
+            End If\r
+\r
+            Do\r
+                index -= 1\r
+                If index = 4 Then\r
+                    Exit Do\r
+                End If\r
+            Loop Until index <= 3\r
+            If index <> 4 Then\r
+                Throw New Exception("#LSA5 - Loop Statenment failed")\r
+            End If\r
+\r
+            If count = 2 Then\r
+                Exit Do\r
+                Exit Do\r
+            End If\r
+\r
+        Loop\r
+\r
+    End Sub\r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/ModuleB.vb b/mcs/mbas/Test/tests/ModuleB.vb
new file mode 100755 (executable)
index 0000000..ec2c86e
--- /dev/null
@@ -0,0 +1,23 @@
+NameSpace NS
+       Public Module M1
+               Public a As Integer
+               public Const b as integer = 10
+               Class C1
+               End Class
+       End Module
+
+       Friend Module MainModule
+               Sub Main()
+                       M1.a = 20
+                       dim x as integer = M1.b
+                       if (x <> 10) then
+                               Throw new System.Exception("#A1, Unexpected result")
+                       end if
+
+                       x = NS.M1.b
+                       if x <> 10 then
+                               Throw new System.Exception("#A2, Unexpected result")
+                       end if
+               End Sub
+       End Module
+End NameSpace
diff --git a/mcs/mbas/Test/tests/ModuleTest.vb b/mcs/mbas/Test/tests/ModuleTest.vb
new file mode 100755 (executable)
index 0000000..a968f62
--- /dev/null
@@ -0,0 +1,13 @@
+Imports System
+Module ModuleTest
+       Dim a As Integer=30
+       Sub Main()
+               Dim a As Integer
+               If a<>0 Then    
+                       Throw New Exception("#A1: Module:Failed")
+               End If  
+               If ModuleTest.a<>30 Then
+                       Throw New Exception("#A2: Module: Failed")
+               End If
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/MustInherit.vb b/mcs/mbas/Test/tests/MustInherit.vb
new file mode 100755 (executable)
index 0000000..ce24e7c
--- /dev/null
@@ -0,0 +1,34 @@
+MustInherit Class C1\r
+    Public Function F1()\r
+        Dim a As Integer = 10\r
+    End Function\r
+
+    Public MustOverride Function F2()\r
+End Class\r
+\r
+Class C2\r
+    Inherits C1\r
+    Public Overrides Function F2()\r
+    End Function\r
+End Class\r
+\r
+MustInherit Class C3\r
+    Public MustOverride Function func()\r
+End Class\r
+\r
+MustInherit Class C4\r
+    Inherits C3\r
+End Class\r
+\r
+Class C5\r
+    Inherits C4\r
+    Public Overrides Function func()\r
+    End Function\r
+End Class\r
+\r
+Module Module1\r
+    Sub Main()\r
+        Dim x As C1 = Nothing\r
+        x = New C2()\r
+    End Sub\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/MustInheritA.vb b/mcs/mbas/Test/tests/MustInheritA.vb
new file mode 100755 (executable)
index 0000000..d91b39a
--- /dev/null
@@ -0,0 +1,21 @@
+'Testing MustInherit classes with MustOverride methods that do not return a value\r
+\r
+MustInherit Class C1\r
+    Public Function F1()\r
+        Dim a As Integer = 10\r
+    End Function\r
+    Public MustOverride Function F2()\r
+End Class\r
+\r
+Class C2\r
+    Inherits C1\r
+    Public Overrides Function F2()\r
+    End Function\r
+End Class\r
+\r
+Module Module1\r
+    Sub Main()\r
+        Dim x As C1 = Nothing\r
+        x = New C2()\r
+    End Sub\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/NameSpace.vb b/mcs/mbas/Test/tests/NameSpace.vb
new file mode 100755 (executable)
index 0000000..963bef1
--- /dev/null
@@ -0,0 +1,9 @@
+Imports System
+Namespace NS1
+       Module M
+               Dim a As Integer=20
+               Sub Main()
+               End Sub
+       End Module
+End Namespace
+
diff --git a/mcs/mbas/Test/tests/NameSpaceC.vb b/mcs/mbas/Test/tests/NameSpaceC.vb
new file mode 100755 (executable)
index 0000000..ef8ddde
--- /dev/null
@@ -0,0 +1,11 @@
+Imports System
+Namespace NS1
+       Namespace NNS1
+               Module M
+                       Sub Main()
+                       End Sub
+               End Module
+
+       End Namespace
+End Namespace
+
diff --git a/mcs/mbas/Test/tests/NotInheritable.vb b/mcs/mbas/Test/tests/NotInheritable.vb
new file mode 100755 (executable)
index 0000000..4bf3650
--- /dev/null
@@ -0,0 +1,8 @@
+NotInheritable Class C1\r
+End Class\r
+\r
+Module Module1\r
+    Sub Main()\r
+        Dim x As New C1()\r
+    End Sub\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/OptionalA.vb b/mcs/mbas/Test/tests/OptionalA.vb
new file mode 100755 (executable)
index 0000000..c183069
--- /dev/null
@@ -0,0 +1,66 @@
+Imports System
+
+Module Test
+    Enum E
+        A
+        B
+    End Enum
+    Function F(Optional i As Integer = 42) As Integer
+        F = i + 1
+    End Function
+    Function F2(ByVal Optional i As Integer = 42) As Integer
+        F2 = i + 1
+    End Function
+    Function G(i As Integer, Optional j As Integer = 42) As Integer
+        G = i + j
+    End Function
+    Function G(e As E) As Integer
+        G = e
+    End Function
+    Function H(i As Integer, Optional j As Integer = 42, Optional k As Integer = 3) As Integer
+        H = i + j + k
+    End Function
+    Function K(ByRef Optional i As Integer = 3) As Integer
+        K = i
+        i = i + 3
+    End Function
+    Sub Main
+        If F() <> 43 Then
+            Throw New Exception("#A1: unexpected return value")
+        End If
+        If F(99) <> 100 Then
+            Throw New Exception("#A2: unexpected return value")
+        End If
+        If F2() <> 43 Then
+            Throw New Exception("#A3: unexpected return value")
+        End If
+        If G(1) <> 43 Then
+            Throw New Exception("#A4: unexpected return value")
+        End If
+        If G(E.A) <> 0 Then
+            Throw New Exception("#A5: unexpected return value")
+        End If
+        If G(1,99) <> 100 Then
+            Throw New Exception("#A6: unexpected return value")
+        End If
+        If G(E.A,99) <> 99 Then
+            Throw New Exception("#A7: unexpected return value")
+        End If
+        If H(1) <> 46 Then
+            Throw New Exception("#A8: unexpected return value")
+        End If
+        If H(1,0) <> 4 Then
+            Throw New Exception("#A9: unexpected return value")
+        End If
+        If H(E.A) <> 45 Then
+            Throw New Exception("#A10: unexpected return value")
+        End If
+        If K() <> 3 Then
+            Throw New Exception("#A11: unexpected return value")
+        End If
+        Dim i As Integer = 9
+        If K(i) <> 9 OrElse i <> 12 Then
+            Throw New Exception("#A12: unexpected return value")
+        End If
+    End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/OptionalArgFunction1.vb b/mcs/mbas/Test/tests/OptionalArgFunction1.vb
new file mode 100755 (executable)
index 0000000..6a7885e
--- /dev/null
@@ -0,0 +1,32 @@
+'=============================================================================================
+'Name:Manish Kumar Sinha 
+'Email Address: manishkumarsinha@sify.com
+'Test Case Name: Argument passing by Optional Keyword:
+'O.P-1.0.0: An Optional parameter must specify a constant expression to be used a replacement
+'              value if no argument is specified.When we omit one or more optional arguments in
+'               the argument list, you use successive commas to mark their positions. 
+'              If we don't mark commas then it produce run time error
+'=============================================================================================
+
+Imports System
+Module OP1_0_0
+       Function F(ByVal telephoneNo as Long, Optional ByVal code as Integer = 080,Optional ByVal code1  As Integer = 091, Optional ByRef name As String="Sinha") As Boolean
+               if (code = 080 and code1 = 091 and name="Manish")
+                       return true
+               else
+                       return false
+               end if
+               
+       End Function 
+   
+   Sub Main()
+      Dim telephoneNo As Long = 9886066432
+       Dim name As String ="Manish"
+       Dim status As Boolean
+      status =F(telephoneNo,name) 
+       if (status = false)
+               Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_0")
+       end if
+   End Sub 
+
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/OptionalArgu_ByRefFuncA.vb b/mcs/mbas/Test/tests/OptionalArgu_ByRefFuncA.vb
new file mode 100755 (executable)
index 0000000..abbe48c
--- /dev/null
@@ -0,0 +1,30 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Optional Keyword:\r
+'O.P-1.0.1: An Optional parameter must specify a constant expression to be used a replacement\r
+'              value if no argument is specified.\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module OP1_0_1\r
+       Function F(ByVal telephoneNo as Long, Optional ByRef code as Integer = 080) As Boolean\r
+               if (code = 080)\r
+                       return false\r
+               else \r
+                       return true\r
+               end if\r
+       End Function \r
+   \r
+   Sub Main()\r
+      Dim telephoneNo As Long = 9886066432\r
+        Dim code As Integer = 081\r
+       Dim status as Boolean\r
+     status = F(telephoneNo,code)\r
+       if(status = false)\r
+               Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_1")\r
+       end if\r
+\r
+   End Sub \r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/OptionalArgu_ByRefFuncB.vb b/mcs/mbas/Test/tests/OptionalArgu_ByRefFuncB.vb
new file mode 100755 (executable)
index 0000000..09ebc5e
--- /dev/null
@@ -0,0 +1,29 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Optional Keyword:\r
+'O.P-1.0.0: An Optional parameter must specify a constant expression to be used a replacement\r
+'              value if no argument is specified.\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module OP1_0_0\r
+       Function F(ByVal telephoneNo as Long, Optional ByRef code as Integer = 080) As Boolean\r
+               if (code <> 080)\r
+                       return false\r
+               else \r
+                       return true\r
+\r
+               end if\r
+       End Function \r
+   \r
+   Sub Main()\r
+      Dim telephoneNo As Long = 9886066432\r
+       Dim status as Boolean\r
+      status = F(telephoneNo)\r
+       if(status = false)\r
+               Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_1")\r
+       end if\r
+   End Sub \r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/OptionalArgu_ByRefFuncC.vb b/mcs/mbas/Test/tests/OptionalArgu_ByRefFuncC.vb
new file mode 100755 (executable)
index 0000000..3e4a8ae
--- /dev/null
@@ -0,0 +1,31 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Optional Keyword:\r
+'O.P-1.0.1: An Optional parameter must specify a constant expression to be used a replacement\r
+'              value if no argument is specified.\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module OP1_0_1\r
+       Function F(ByVal telephoneNo as Long, Optional ByRef code as Integer = 080, Optional ByVal code1  As Integer = 091)\r
+               if (code = 080 and code1 = 091)\r
+                       return false\r
+               else \r
+                       return true\r
+\r
+               end if\r
+       End Function \r
+   \r
+   Sub Main()\r
+      Dim telephoneNo As Long = 9886066432\r
+        Dim code As Integer = 081\r
+       Dim code1 As Integer = 091\r
+       Dim status as Boolean\r
+      status = F(telephoneNo,code,code1)\r
+       if(status = false)\r
+               Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_1")\r
+       end if\r
+   End Sub \r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/OptionalArgu_ByRefFuncD.vb b/mcs/mbas/Test/tests/OptionalArgu_ByRefFuncD.vb
new file mode 100755 (executable)
index 0000000..db44134
--- /dev/null
@@ -0,0 +1,29 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Optional Keyword:\r
+'O.P-1.0.0: An Optional parameter must specify a constant expression to be used a replacement\r
+'              value if no argument is specified.\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module OP1_0_0\r
+       Function F(ByVal telephoneNo as Long, Optional ByRef code as Integer = 080,Optional ByVal code1  As Integer = 091) As Boolean\r
+               if (code <> 080 and code1 <> 091)\r
+                       return false\r
+               else \r
+                       return true\r
+\r
+               end if\r
+       End Function \r
+   \r
+   Sub Main()\r
+      Dim telephoneNo As Long = 9886066432\r
+       Dim status as Boolean\r
+     status = F(telephoneNo)\r
+       if(status = false)\r
+               Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_1")\r
+       end if\r
+   End Sub \r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/OptionalArgu_ByReferenceA.vb b/mcs/mbas/Test/tests/OptionalArgu_ByReferenceA.vb
new file mode 100755 (executable)
index 0000000..fa260c8
--- /dev/null
@@ -0,0 +1,23 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Optional Keyword:\r
+'O.P-1.0.1: An Optional parameter must specify a constant expression to be used a replacement\r
+'              value if no argument is specified.\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module OP1_0_1\r
+       Sub F(ByVal telephoneNo as Long, Optional ByRef code as Integer = 080)\r
+               if (code = 080)\r
+                       Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_1")\r
+               end if\r
+       End Sub \r
+   \r
+   Sub Main()\r
+      Dim telephoneNo As Long = 9886066432\r
+        Dim code As Integer = 081\r
+      F(telephoneNo,code)\r
+   End Sub \r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/OptionalArgu_ByReferenceB.vb b/mcs/mbas/Test/tests/OptionalArgu_ByReferenceB.vb
new file mode 100755 (executable)
index 0000000..6fcd54a
--- /dev/null
@@ -0,0 +1,22 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Optional Keyword:\r
+'O.P-1.0.0: An Optional parameter must specify a constant expression to be used a replacement\r
+'              value if no argument is specified.\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module OP1_0_0\r
+       Sub F(ByVal telephoneNo as Long, Optional ByRef code as Integer = 080)\r
+               if (code <> 080)\r
+                       Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_0")\r
+               end if\r
+       End Sub \r
+   \r
+   Sub Main()\r
+      Dim telephoneNo As Long = 9886066432\r
+      F(telephoneNo)\r
+   End Sub \r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/OptionalArgu_ByReferenceC.vb b/mcs/mbas/Test/tests/OptionalArgu_ByReferenceC.vb
new file mode 100755 (executable)
index 0000000..bc8ce23
--- /dev/null
@@ -0,0 +1,24 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Optional Keyword:\r
+'O.P-1.0.1: An Optional parameter must specify a constant expression to be used a replacement\r
+'              value if no argument is specified.\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module OP1_0_1\r
+       Sub F(ByVal telephoneNo as Long, Optional ByRef code as Integer = 080, Optional ByVal code1  As Integer = 091)\r
+               if (code = 080 and code1 = 091)\r
+                       Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_1")\r
+               end if\r
+       End Sub \r
+   \r
+   Sub Main()\r
+      Dim telephoneNo As Long = 9886066432\r
+        Dim code As Integer = 081\r
+       Dim code1 As Integer = 091\r
+      F(telephoneNo,code,code1)\r
+   End Sub \r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/OptionalArgu_ByReferenceD.vb b/mcs/mbas/Test/tests/OptionalArgu_ByReferenceD.vb
new file mode 100755 (executable)
index 0000000..137c1fd
--- /dev/null
@@ -0,0 +1,22 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Optional Keyword:\r
+'O.P-1.0.0: An Optional parameter must specify a constant expression to be used a replacement\r
+'              value if no argument is specified.\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module OP1_0_0\r
+       Sub F(ByVal telephoneNo as Long, Optional ByRef code as Integer = 080,Optional ByVal code1  As Integer = 091)\r
+               if (code <> 080 and code1 <> 091)\r
+                       Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_0")\r
+               end if\r
+       End Sub \r
+   \r
+   Sub Main()\r
+      Dim telephoneNo As Long = 9886066432\r
+      F(telephoneNo)\r
+   End Sub \r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/OptionalArgu_ByValFuncA.vb b/mcs/mbas/Test/tests/OptionalArgu_ByValFuncA.vb
new file mode 100755 (executable)
index 0000000..831054e
--- /dev/null
@@ -0,0 +1,28 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Optional Keyword:\r
+'O.P-1.0.0: An Optional parameter must specify a constant expression to be used a replacement\r
+'              value if no argument is specified.\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module OP1_0_0\r
+       Function F(ByVal telephoneNo as Long, Optional ByVal code as Integer = 080) As Boolean\r
+               if (code <> 080)\r
+                       return false\r
+               else \r
+                       return true                     \r
+               end if\r
+       End Function \r
+   \r
+   Sub Main()\r
+      Dim telephoneNo As Long = 9886066432\r
+       Dim status as Boolean\r
+      status = F(telephoneNo)\r
+       if(status = false)\r
+               Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_1")\r
+       end if\r
+   End Sub \r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/OptionalArgu_ByValFuncB.vb b/mcs/mbas/Test/tests/OptionalArgu_ByValFuncB.vb
new file mode 100755 (executable)
index 0000000..00b080c
--- /dev/null
@@ -0,0 +1,29 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Optional Keyword:\r
+'O.P-1.0.1: An Optional parameter must specify a constant expression to be used a replacement\r
+'              value if no argument is specified.\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module OP1_0_1\r
+       Function F(ByVal telephoneNo as Long, Optional ByVal code as Integer = 080) As Boolean\r
+               if (code = 080)\r
+               return false\r
+               else \r
+                       return true\r
+               end if\r
+       End Function\r
+   \r
+   Sub Main()\r
+      Dim telephoneNo As Long = 9886066432\r
+        Dim code As Integer = 081\r
+       Dim status as Boolean\r
+      status = F(telephoneNo,code)\r
+       if(status = false)\r
+               Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_1")\r
+       end if\r
+   End Sub \r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/OptionalArgu_ByValFuncC.vb b/mcs/mbas/Test/tests/OptionalArgu_ByValFuncC.vb
new file mode 100755 (executable)
index 0000000..f34933c
--- /dev/null
@@ -0,0 +1,28 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Optional Keyword:\r
+'O.P-1.0.0: An Optional parameter must specify a constant expression to be used a replacement\r
+'              value if no argument is specified.\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module OP1_0_0\r
+       Function F(ByVal telephoneNo as Long, Optional ByVal code as Integer = 080,Optional ByVal code1  As Integer = 091) as Boolean\r
+               if (code <> 080 and code1 <> 091)\r
+                       return false\r
+               else \r
+                       return true\r
+               end if\r
+       End Function \r
+   \r
+   Sub Main()\r
+      Dim telephoneNo As Long = 9886066432\r
+       Dim status as Boolean\r
+      status = F(telephoneNo)\r
+       if(status = false)\r
+               Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_1")\r
+       end if\r
+   End Sub \r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/OptionalArgu_ByValFuncD.vb b/mcs/mbas/Test/tests/OptionalArgu_ByValFuncD.vb
new file mode 100755 (executable)
index 0000000..8f4bb0b
--- /dev/null
@@ -0,0 +1,31 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Optional Keyword:\r
+'O.P-1.0.1: An Optional parameter must specify a constant expression to be used a replacement\r
+'              value if no argument is specified.\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module OP1_0_1\r
+       Function F(ByVal telephoneNo as Long, Optional ByVal code as Integer = 080, Optional ByVal code1  As Integer = 091) as Boolean\r
+               if (code = 080 and code1 = 091)\r
+                       return false\r
+               else \r
+                       return true\r
+               end if\r
+       End Function \r
+   \r
+   Sub Main()\r
+      Dim telephoneNo As Long = 9886066432\r
+        Dim code As Integer = 081\r
+       Dim code1 As Integer = 091\r
+       Dim status as Boolean\r
+\r
+      status = F(telephoneNo,code,code1)\r
+       if(status = false)\r
+               Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_1")\r
+       end if\r
+   End Sub \r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/OptionalArgu_ByValFuncE.vb b/mcs/mbas/Test/tests/OptionalArgu_ByValFuncE.vb
new file mode 100755 (executable)
index 0000000..4af6c55
--- /dev/null
@@ -0,0 +1,32 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Optional Keyword:\r
+'O.P-1.0.0: An Optional parameter must specify a constant expression to be used a replacement\r
+'              value if no argument is specified.When you omit one or more optional arguments in\r
+'               the argument list, you use successive commas to mark their positions. \r
+'              The following example call supplies the first and fourth arguments but not the\r
+'               second or third:\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module OP1_0_0\r
+       Function F(ByVal telephoneNo as Long, Optional ByVal code as Integer = 080,Optional ByVal code1  As Integer = 091, Optional ByRef name As String="Sinha") As Boolean\r
+               if (code <> 080 and code1 <> 091 and name="Sinha")\r
+                       return false\r
+               else \r
+                       return true\r
+               end if\r
+       End Function \r
+   \r
+   Sub Main()\r
+      Dim telephoneNo As Long = 9886066432\r
+       Dim name As String ="Manish"\r
+       Dim status as Boolean\r
+      status = F(telephoneNo,,,name)\r
+       if(status = false)\r
+               Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_1")\r
+       end if\r
+   End Sub \r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/OptionalArgu_ByValueA.vb b/mcs/mbas/Test/tests/OptionalArgu_ByValueA.vb
new file mode 100755 (executable)
index 0000000..4184aed
--- /dev/null
@@ -0,0 +1,22 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Optional Keyword:\r
+'O.P-1.0.0: An Optional parameter must specify a constant expression to be used a replacement\r
+'              value if no argument is specified.\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module OP1_0_0\r
+       Sub F(ByVal telephoneNo as Long, Optional ByVal code as Integer = 080)\r
+               if (code <> 080)\r
+                       Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_0")\r
+               end if\r
+       End Sub \r
+   \r
+   Sub Main()\r
+      Dim telephoneNo As Long = 9886066432\r
+      F(telephoneNo)\r
+   End Sub \r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/OptionalArgu_ByValueB.vb b/mcs/mbas/Test/tests/OptionalArgu_ByValueB.vb
new file mode 100755 (executable)
index 0000000..e301154
--- /dev/null
@@ -0,0 +1,23 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Optional Keyword:\r
+'O.P-1.0.1: An Optional parameter must specify a constant expression to be used a replacement\r
+'              value if no argument is specified.\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module OP1_0_1\r
+       Sub F(ByVal telephoneNo as Long, Optional ByVal code as Integer = 080)\r
+               if (code = 080)\r
+                       Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_1")\r
+               end if\r
+       End Sub \r
+   \r
+   Sub Main()\r
+      Dim telephoneNo As Long = 9886066432\r
+        Dim code As Integer = 081\r
+      F(telephoneNo,code)\r
+   End Sub \r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/OptionalArgu_ByValueC.vb b/mcs/mbas/Test/tests/OptionalArgu_ByValueC.vb
new file mode 100755 (executable)
index 0000000..c2a0f7a
--- /dev/null
@@ -0,0 +1,22 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Optional Keyword:\r
+'O.P-1.0.0: An Optional parameter must specify a constant expression to be used a replacement\r
+'              value if no argument is specified.\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module OP1_0_0\r
+       Sub F(ByVal telephoneNo as Long, Optional ByVal code as Integer = 080,Optional ByVal code1  As Integer = 091) \r
+               if (code <> 080 and code1 <> 091)\r
+                       Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_1")\r
+               end if\r
+       End Sub \r
+   \r
+   Sub Main()\r
+      Dim telephoneNo As Long = 9886066432\r
+      F(telephoneNo)\r
+   End Sub \r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/OptionalArgu_ByValueD.vb b/mcs/mbas/Test/tests/OptionalArgu_ByValueD.vb
new file mode 100755 (executable)
index 0000000..daa2935
--- /dev/null
@@ -0,0 +1,24 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Optional Keyword:\r
+'O.P-1.0.1: An Optional parameter must specify a constant expression to be used a replacement\r
+'              value if no argument is specified.\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module OP1_0_1\r
+       Sub F(ByVal telephoneNo as Long, Optional ByVal code as Integer = 080, Optional ByVal code1  As Integer = 091)\r
+               if (code = 080 and code1 = 091)\r
+                       Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_1")\r
+               end if\r
+       End Sub \r
+   \r
+   Sub Main()\r
+      Dim telephoneNo As Long = 9886066432\r
+        Dim code As Integer = 081\r
+       Dim code1 As Integer = 091\r
+      F(telephoneNo,code,code1)\r
+   End Sub \r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/OptionalArgu_ByValueE.vb b/mcs/mbas/Test/tests/OptionalArgu_ByValueE.vb
new file mode 100755 (executable)
index 0000000..1ec5ff4
--- /dev/null
@@ -0,0 +1,26 @@
+'=============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Argument passing by Optional Keyword:\r
+'O.P-1.0.0: An Optional parameter must specify a constant expression to be used a replacement\r
+'              value if no argument is specified.When you omit one or more optional arguments in\r
+'               the argument list, you use successive commas to mark their positions. \r
+'              The following example call supplies the first and fourth arguments but not the\r
+'               second or third:\r
+'=============================================================================================\r
+\r
+Imports System\r
+Module OP1_0_0\r
+       Sub F(ByVal telephoneNo as Long, Optional ByVal code as Integer = 080,Optional ByVal code1  As Integer = 091, Optional ByRef name As String="Sinha")\r
+               if (code <> 080 and code1 <> 091 and name="Sinha")\r
+                       Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_0")\r
+               end if\r
+       End Sub \r
+   \r
+   Sub Main()\r
+      Dim telephoneNo As Long = 9886066432\r
+       Dim name As String ="Manish"\r
+      F(telephoneNo,,,name)\r
+   End Sub \r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/OptionalArgument1.vb b/mcs/mbas/Test/tests/OptionalArgument1.vb
new file mode 100755 (executable)
index 0000000..3cf68ee
--- /dev/null
@@ -0,0 +1,25 @@
+'=============================================================================================
+'Name:Manish Kumar Sinha 
+'Email Address: manishkumarsinha@sify.com
+'Test Case Name: Argument passing by Optional Keyword:
+'O.P-1.0.0: An Optional parameter must specify a constant expression to be used a replacement
+'              value if no argument is specified.When we omit one or more optional arguments in
+'               the argument list, you use successive commas to mark their positions. 
+'              If we don't mark commas then it produce run time error
+'=============================================================================================
+
+Imports System
+Module OP1_0_0
+       Sub F(ByVal telephoneNo as Long, Optional ByVal code as Integer = 080,Optional ByVal code1  As Integer = 091, Optional ByRef name As String="Sinha")
+               if (code <> 080 and code1 <> 091 and name="Sinha")
+                       Throw New System.Exception("#A1, Unexcepted behaviour in string of OP1_0_0")
+               end if
+       End Sub 
+   
+   Sub Main()
+      Dim telephoneNo As Long = 9886066432
+       Dim name As String ="Manish"
+      F(telephoneNo,name)
+   End Sub 
+
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/Overloading.vb b/mcs/mbas/Test/tests/Overloading.vb
new file mode 100755 (executable)
index 0000000..1d0e596
--- /dev/null
@@ -0,0 +1,23 @@
+Class c\r
+    Function f()\r
+    End Function\r
+\r
+    Function f(ByVal i As Integer)\r
+    End Function\r
+\r
+    Function f(ByVal s As String)\r
+    End Function\r
+\r
+    Function f(ByVal i1 As Integer, ByVal i2 As Integer)\r
+    End Function\r
+End Class\r
+\r
+\r
+Module Overloading\r
+    Sub s()\r
+    End Sub\r
+\r
+    Sub Main()\r
+    End Sub\r
+\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/OverloadingA.vb b/mcs/mbas/Test/tests/OverloadingA.vb
new file mode 100755 (executable)
index 0000000..f69e15d
--- /dev/null
@@ -0,0 +1,36 @@
+'Testing overloading in different classes
+Class B
+    Function F()
+    End Function
+
+    Function F(ByVal i As Integer)
+    End Function
+
+    Function F1()
+    End Function
+
+    Function F1(ByVal i As Integer)
+    End Function
+End Class
+
+Class D
+    Inherits B
+
+    Overloads Function F()
+    End Function
+End Class
+
+Module OverloadingA
+    Sub Main()
+        Dim x As D = New D()
+
+        x.F()
+        x.F(10)
+        x.F1(20)
+
+       Dim x1 As B=New B()
+       x1.F(20)
+       x1.F1()
+    End Sub
+
+End Module
diff --git a/mcs/mbas/Test/tests/OverrideA.vb b/mcs/mbas/Test/tests/OverrideA.vb
new file mode 100755 (executable)
index 0000000..5c8dcac
--- /dev/null
@@ -0,0 +1,34 @@
+Class B\r
+    Overridable Function F() As Integer\r
+        Return 5\r
+    End Function\r
+End Class\r
+\r
+Class D\r
+    Inherits B\r
+\r
+    Overrides Function F() As Integer\r
+        ' you should be able to access \r
+        ' the members of base class \r
+        ' using 'MyBase' as follows\r
+        MyBase.F()\r
+\r
+        Return 10\r
+    End Function\r
+End Class\r
+\r
+Module OverrideA\r
+    Sub Main()\r
+        Dim x As B\r
+\r
+        x = New B()\r
+        If x.F() <> 5 Then\r
+            Throw New System.Exception("#A1, unexpected result from base class")\r
+        End If\r
+\r
+        x = New D()\r
+        If x.F() <> 10 Then\r
+            Throw New System.Exception("#A2, unexpected result from derived class")\r
+        End If\r
+    End Sub\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/OverrideB.vb b/mcs/mbas/Test/tests/OverrideB.vb
new file mode 100755 (executable)
index 0000000..94ceb23
--- /dev/null
@@ -0,0 +1,29 @@
+Class B
+    Public Overridable Sub F1()
+    End Sub
+
+    Public Overridable Sub F2()
+    End Sub
+End Class
+
+Class D
+    Inherits B
+
+    Public NotOverridable Overrides Sub F1()
+    End Sub
+
+    Public Overrides Sub F2()
+    End Sub
+End Class
+
+Class D1
+    Inherits D
+
+    Public Overrides Sub F2()
+    End Sub
+End Class\r
+\r
+Module OverrideB\r
+    Sub Main()\r
+    End Sub\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/Override_exe.vb b/mcs/mbas/Test/tests/Override_exe.vb
new file mode 100644 (file)
index 0000000..31b02a3
--- /dev/null
@@ -0,0 +1,35 @@
+Imports System
+Imports NSOverride
+
+
+Class D
+       Inherits B2
+
+       Public Overrides Sub S1(i as integer)
+       End Sub
+
+       Public Overrides Sub S2(i as integer, j as string)
+       End Sub
+
+       Public Overrides readonly Property SS(i as integer, y as string) As Integer
+               get
+               End Get
+       End Property
+
+       Public Overrides writeonly Property SS1(i as integer, y as string) as Integer
+               set (Value As Integer)
+               End Set
+       End Property
+
+       Public Overrides Property SS2(i as integer, y as string) as Integer
+               get
+               End Get
+               set (Value As Integer)
+               End Set
+       End Property
+End Class
+
+Module M
+       Sub main
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/ParamArrayA.vb b/mcs/mbas/Test/tests/ParamArrayA.vb
new file mode 100755 (executable)
index 0000000..cc68616
--- /dev/null
@@ -0,0 +1,25 @@
+'============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: Param Array:\r
+'APR-1.2.1: If ParamArray modifier is precied by ByVal modifier the it produces doesn't\r
+'              produces compiler error\r
+'============================================================================================\r
+Imports System\r
+Module PA_1_2_1\r
+   Sub F(ParamArray ByVal args() As Integer)\r
+       Dim a as Integer\r
+       a = args.Length\r
+       if a=0\r
+               Throw New System.Exception("#A1, Unexcepted behavoiur of PARAM ARRAY")\r
+       end if\r
+\r
+   End Sub\r
+   Sub Main()\r
+      Dim a As Integer() = { 1, 2, 3 }\r
+      F(a)\r
+      F(10, 20, 30, 40)\r
+   End Sub\r
+End Module\r
+\r
+'=================================================================================
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/ParamArrayB.vb b/mcs/mbas/Test/tests/ParamArrayB.vb
new file mode 100755 (executable)
index 0000000..b1d3c5f
--- /dev/null
@@ -0,0 +1,22 @@
+'============================================================================================\r
+'Name:Manish Kumar Sinha \r
+'Email Address: manishkumarsinha@sify.com\r
+'Test Case Name: ParamArray:\r
+'APR-1.0.0: ParamArray can be used only on the last argument of argument list. it allows us to 'pass an arbitrary list. It allows us to pass an arbitrary number of argument to the procedure \r
+'=============================================================================================\r
+Imports System\r
+Module PA_1_0_0\r
+   Sub F(ParamArray args() As Integer)\r
+       Dim a as Integer\r
+       a=args.Length\r
+       if a=0\r
+               Throw New System.Exception("#A1, Unexcepted behavoiur of PARAM ARRAY")\r
+       end if\r
+   End Sub\r
+   Sub Main()\r
+      Dim a As Integer() = { 1, 2, 3 }\r
+      F(a)\r
+      F(10, 20, 30, 40)\r
+   End Sub\r
+End Module\r
+'=============================================================================================
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/PropertyA.vb b/mcs/mbas/Test/tests/PropertyA.vb
new file mode 100755 (executable)
index 0000000..33e7f3d
--- /dev/null
@@ -0,0 +1,20 @@
+Module M
+       private i as integer
+
+       public Property p() as Integer
+               GET
+                       return i
+               END GET
+
+               SET (ByVal val as Integer)
+                       i = val
+               End SET
+
+       End Property
+
+       Sub Main()
+               p = 10
+               System.Console.WriteLine(p)
+       End Sub
+
+End Module
diff --git a/mcs/mbas/Test/tests/PropertyB.vb b/mcs/mbas/Test/tests/PropertyB.vb
new file mode 100755 (executable)
index 0000000..546f5cb
--- /dev/null
@@ -0,0 +1,21 @@
+IMPORTS SYSTEM
+Module M
+       private i as integer
+
+       public Property p() as Integer
+               GET
+                       return i
+               END GET
+
+               SET
+                       i = Value
+               End SET
+
+       End Property
+
+       Sub Main()
+               p = 10
+               Console.WriteLine(p)
+       End Sub
+
+End Module
diff --git a/mcs/mbas/Test/tests/PropertyC.vb b/mcs/mbas/Test/tests/PropertyC.vb
new file mode 100755 (executable)
index 0000000..a422654
--- /dev/null
@@ -0,0 +1,22 @@
+Imports system\r
+\r
+Module M\r
+       private i as integer\r
+\r
+       public Property p(ByVal x as Integer) as Integer\r
+               GET\r
+                       return i \r
+               END GET\r
+\r
+               SET (ByVal val as Integer)\r
+                       i = val\r
+               End SET\r
+\r
+       End Property\r
+\r
+       Sub Main()\r
+               p(5) = 10\r
+                'Console.WriteLine(p)\r
+       End Sub\r
+\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/PropertyD.vb b/mcs/mbas/Test/tests/PropertyD.vb
new file mode 100755 (executable)
index 0000000..d6dba5b
--- /dev/null
@@ -0,0 +1,22 @@
+Imports system
+
+Module M
+       private i as integer
+
+       public WriteOnly Property p() as Integer
+               SET (ByVal val as Integer)
+                       i = val
+               End SET
+       End Property
+
+       public ReadOnly Property p1() as Integer
+               GET
+                       return i
+               END GET
+       End Property
+
+
+       Sub Main()
+       End Sub
+
+End Module
diff --git a/mcs/mbas/Test/tests/QualifiedNames.vb b/mcs/mbas/Test/tests/QualifiedNames.vb
new file mode 100755 (executable)
index 0000000..6520492
--- /dev/null
@@ -0,0 +1,31 @@
+Imports System\r
+Namespace N1\r
+       Namespace N2\r
+               Class C1\r
+                       Public Shared a As Integer\r
+                       Public Shared b As Integer\r
+                       Public Shared Function F() As Integer\r
+                               Try\r
+                                       N1.N2.C1.a=20\r
+                               Catch e As Exception\r
+                                       Console.WriteLine("error resolving a fully qualified name")\r
+                               End Try\r
+                               b=30\r
+                               Return 47\r
+                       End Function\r
+               End Class\r
+       End Namespace\r
+End Namespace\r
+Module QualifiedNames\r
+       Sub Main()\r
+               If N1.N2.C1.F()<>47 Then\r
+                       Throw New Exception("#A1:QualifiedNames:Failed-Error accessing function using fully qualified names")\r
+               End If\r
+               If N1.N2.C1.a<>20 Then\r
+                       Throw New Exception("#A2:QualifiedNames:Failed-Error accessing variables using fully qualified names")\r
+               End If\r
+               If N1.N2.C1.b<>30 Then\r
+                       Throw New Exception("#A3:QualifiedNames:Failed-Error accessing variables using fully qualified names")\r
+               End If\r
+       End Sub\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/RegionDirectives.vb b/mcs/mbas/Test/tests/RegionDirectives.vb
new file mode 100755 (executable)
index 0000000..e7d999d
--- /dev/null
@@ -0,0 +1,15 @@
+Imports System
+#Region "RegionDirectives"
+Module RegionDirectives
+               Sub Main()
+               
+               End Sub
+
+       #Region "S"             
+       Sub S()
+               
+       End Sub
+       #End Region
+End Module
+#End Region
+
diff --git a/mcs/mbas/Test/tests/RegionDirectivesA.vb b/mcs/mbas/Test/tests/RegionDirectivesA.vb
new file mode 100755 (executable)
index 0000000..efdd7ea
--- /dev/null
@@ -0,0 +1,19 @@
+Imports System
+Module RegionDirectives
+       #Region "Main"
+       Sub Main()
+
+
+       End Sub
+       
+       #Region "S"
+       Sub S()
+
+
+
+       End Sub
+       #End Region
+
+       #End Region
+End Module
+
diff --git a/mcs/mbas/Test/tests/RelationalOperators.vb b/mcs/mbas/Test/tests/RelationalOperators.vb
new file mode 100755 (executable)
index 0000000..dc29dd7
--- /dev/null
@@ -0,0 +1,102 @@
+\r
+Imports System\r
+\r
+Module M1\r
+\r
+    Sub Main()\r
+        Console.WriteLine(f1())\r
+    End Sub\r
+\r
+    Function f1() As Integer\r
+\r
+        Dim a As Long = 0\r
+        Dim arr(17) As Boolean\r
+\r
+        If a < System.Int64.MaxValue Then\r
+            arr(0) = True\r
+        End If\r
+\r
+        If a <= System.Int64.MaxValue Then\r
+            arr(1) = True\r
+        End If\r
+\r
+        If System.Int64.MaxValue > a Then\r
+            arr(2) = True\r
+        End If\r
+\r
+        If System.Int64.MaxValue >= a Then\r
+            arr(3) = True\r
+        End If\r
+\r
+        If a <> System.Int64.MaxValue Then\r
+            arr(4) = True\r
+        End If\r
+\r
+        If a = System.Int64.MaxValue Then arr(5) = False Else arr(5) = True\r
+\r
+        Dim b As Double = 0.0F\r
+\r
+        If b < System.Double.MaxValue Then\r
+            arr(6) = True\r
+        End If\r
+\r
+        If b <= System.Double.MaxValue Then\r
+            arr(7) = True\r
+        End If\r
+\r
+        If System.Double.MaxValue > b Then\r
+            arr(8) = True\r
+        End If\r
+\r
+        If System.Double.MaxValue >= b Then\r
+            arr(9) = True\r
+        End If\r
+\r
+        If b <> System.Double.MaxValue Then\r
+            arr(10) = True\r
+        End If\r
+\r
+        If b = System.Double.MaxValue Then arr(11) = False Else arr(11) = True\r
+\r
+        Dim c As Decimal = 0D\r
+\r
+        If c < System.Decimal.MaxValue Then\r
+            arr(12) = True\r
+        End If\r
+\r
+        If c <= System.Decimal.MaxValue Then\r
+            arr(13) = True\r
+        End If\r
+\r
+        If System.Decimal.MaxValue > c Then\r
+            arr(14) = True\r
+        End If\r
+\r
+        If System.Decimal.MaxValue >= c Then\r
+            arr(15) = True\r
+        End If\r
+\r
+        If c <> System.Decimal.MaxValue Then\r
+            arr(16) = True\r
+        End If\r
+\r
+        If c = System.Decimal.MaxValue Then arr(17) = False Else arr(17) = True\r
+\r
+        Console.WriteLine("Array length: {0}", arr.GetUpperBound(0))\r
+        For i As Integer = 0 To arr.GetUpperBound(0)\r
+            Console.Write("i:  {0} ", i)\r
+            Console.WriteLine(arr(i))\r
+        Next\r
+\r
+        For Each bval As Boolean In arr\r
+            If Not bval Then\r
+                Return 1\r
+            End If\r
+        Next\r
+\r
+        Return 0\r
+\r
+    End Function\r
+\r
+\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/RelationalOperatorsA.vb b/mcs/mbas/Test/tests/RelationalOperatorsA.vb
new file mode 100755 (executable)
index 0000000..a955e00
--- /dev/null
@@ -0,0 +1,67 @@
+\r
+' Relational Operators\r
+\r
+Imports System\r
+\r
+Module M3\r
+\r
+    Sub main()\r
+        Console.WriteLine(f3())\r
+    End Sub\r
+\r
+    Function f3() As Integer\r
+\r
+        Dim arr(16) As Boolean\r
+\r
+        Dim a1, a2, a3, a4 As Boolean\r
+        a1 = False : a2 = False : a3 = True : a4 = True\r
+\r
+        If a1 = a2 Then arr(0) = True Else arr(0) = False\r
+        If a3 = a4 Then arr(1) = True Else arr(1) = False\r
+        If a1 <> a2 Then arr(2) = False Else arr(2) = True\r
+        If a3 <> a4 Then arr(3) = False Else arr(3) = True\r
+        If a1 = a3 Then arr(4) = False Else arr(4) = True\r
+        If a1 <> a3 Then arr(5) = True Else arr(5) = False\r
+\r
+\r
+        Dim b1 As String = "a"\r
+        Dim b2 As String = "b"\r
+        ' Only the equality (=) and inequality (<>) operators are \r
+        ' defined for Strings \r
+\r
+        If b1 = "a" Then arr(6) = True Else arr(6) = False\r
+        If b1 <> "a" Then arr(7) = False Else arr(7) = True\r
+        If b1 = b2 Then arr(8) = False Else arr(8) = True\r
+        If b1 <> b2 Then arr(9) = True Else arr(9) = False\r
+\r
+        Dim c1 As Date = New Date(2004, 7, 29)\r
+        Dim c2 As Date = New Date(2004, 7, 28)\r
+\r
+        If c1 = c2 Then arr(10) = False Else arr(10) = True\r
+        If c1 <> c2 Then arr(11) = True Else arr(11) = False\r
+        If c1 = "#7/29/2004#" Then arr(12) = True Else arr(12) = False\r
+        If c1 <> "#7/29/2004#" Then arr(12) = False Else arr(12) = True\r
+\r
+        Dim d1 As Char = "a"c\r
+        Dim d2 As Char = "b"c\r
+\r
+        If d1 = "a"c Then arr(13) = True Else arr(13) = False\r
+        If d1 <> "a"c Then arr(14) = False Else arr(14) = True\r
+        If d1 = d2 Then arr(15) = False Else arr(15) = True\r
+        If d1 <> d2 Then arr(16) = True Else arr(16) = False\r
+\r
+        For i As Integer = 0 To arr.GetUpperBound(0) \r
+            Console.WriteLine("{0}: {1}", i, arr(i))\r
+        Next\r
+\r
+        For Each bval As Boolean In arr\r
+            If Not bval Then\r
+                Return 1\r
+            End If\r
+        Next\r
+\r
+        Return 0\r
+\r
+    End Function\r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/Scope.vb b/mcs/mbas/Test/tests/Scope.vb
new file mode 100755 (executable)
index 0000000..f8d56ba
--- /dev/null
@@ -0,0 +1,24 @@
+Module Scope\r
+    Dim i As Integer = 5\r
+\r
+    Function f1()\r
+        If i <> 5 Then\r
+            Throw New System.Exception("#A1, value of i is not correct")\r
+        End If\r
+    End Function\r
+\r
+    Function f2()\r
+        Dim i As Integer = 10\r
+        If i <> 10 Then\r
+            Throw New System.Exception("#A2, value of i is not correct")\r
+        End If\r
+        If Scope.i <> 5 Then\r
+            Throw New System.Exception("#A3, value of i is not correct")\r
+        End If\r
+    End Function\r
+\r
+    Sub Main()\r
+        f1()\r
+        f2()\r
+    End Sub\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/ScopeA.vb b/mcs/mbas/Test/tests/ScopeA.vb
new file mode 100755 (executable)
index 0000000..4351493
--- /dev/null
@@ -0,0 +1,14 @@
+Imports System
+Module Scope1
+       Public Function S() As Integer
+               Return 1
+       End Function
+End Module
+Module Scope
+       Sub Main()
+               Dim a As Integer=S()
+               If a<>1 Then
+                       Throw New Exception("ScopeA:Failed-public method should be visible in other modules too")
+               End If
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/ShadowsA.vb b/mcs/mbas/Test/tests/ShadowsA.vb
new file mode 100755 (executable)
index 0000000..9570095
--- /dev/null
@@ -0,0 +1,34 @@
+Class B
+    Function F()
+    End Function
+
+    Function F(ByVal i As Integer)
+    End Function
+
+    Function F1()
+    End Function
+
+    Function F1(ByVal i As Integer)
+    End Function
+End Class
+
+Class D
+    Inherits B
+
+    Overloads Function F()
+    End Function
+
+    Shadows Function F1(ByVal i As Integer)
+    End Function
+End Class
+
+Module ShadowA\r
+    Sub Main()
+        Dim x As D = New D()
+
+        x.F()
+        x.F(10)
+        x.F1(20)
+    End Sub\r
+\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/ShadowsC.vb b/mcs/mbas/Test/tests/ShadowsC.vb
new file mode 100755 (executable)
index 0000000..ebc25c5
--- /dev/null
@@ -0,0 +1,18 @@
+Interface ILeft
+    Sub F()
+End Interface
+
+Interface IRight
+    Sub F()
+End Interface
+
+Interface ILeftRight
+    Inherits ILeft, IRight
+    Shadows Sub F()
+End Interface
+\r
+\r
+Module ShadowsC\r
+    Sub Main()\r
+    End Sub\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/ShadowsC4.vb b/mcs/mbas/Test/tests/ShadowsC4.vb
new file mode 100755 (executable)
index 0000000..16119b5
--- /dev/null
@@ -0,0 +1,16 @@
+Class B
+    Private Function F()
+    End Function
+End Class
+
+Class D
+    Inherits B
+
+    Shadows Function F()
+    End Function
+End Class
+
+Module ShadowsC3
+    Sub Main()
+    End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/ShadowsD.vb b/mcs/mbas/Test/tests/ShadowsD.vb
new file mode 100755 (executable)
index 0000000..1062ca0
--- /dev/null
@@ -0,0 +1,22 @@
+Class B
+    Public Shared Sub F()
+    End Sub
+End Class
+
+Class D
+    Inherits B
+
+    Private Shared Shadows Sub F()
+    End Sub
+End Class
+
+Class D1
+    Inherits D
+End Class
+\r
+Module ShadowsD\r
+    Sub Main()\r
+        Dim x As New D1()\r
+        x.F()\r
+    End Sub\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/ShiftOperators.vb b/mcs/mbas/Test/tests/ShiftOperators.vb
new file mode 100755 (executable)
index 0000000..ab7e8ca
--- /dev/null
@@ -0,0 +1,97 @@
+Imports System\r
+\r
+Module M\r
+    Sub main()\r
+        Console.WriteLine(f())\r
+    End Sub\r
+\r
+    Function f()\r
+        Dim arr(15) As Boolean\r
+\r
+        ' Left shift operator tests \r
+\r
+        Dim a1 As Byte = 5\r
+\r
+        a1 = a1 << 1001\r
+        If a1 = 10 Then arr(0) = True\r
+\r
+        a1 = Byte.MaxValue\r
+        a1 = a1 << 2001\r
+        If a1 = 254 Then arr(1) = True\r
+\r
+        a1 = Byte.MinValue\r
+        a1 = a1 << 2002\r
+        If a1 = 0 Then arr(2) = True\r
+\r
+        Dim b1 As Integer = 5\r
+        Dim b2 As Integer = -5\r
+\r
+        b1 = b1 << 1001\r
+        If b1 = 2560 Then arr(3) = True\r
+\r
+        b1 = -5\r
+        b1 = b1 << 1001\r
+        If b1 = -2560 Then arr(4) = True\r
+\r
+        b1 = Integer.MaxValue\r
+        b1 = b1 << 1001\r
+        If b1 = -512 Then arr(5) = True\r
+\r
+        b1 = Integer.MinValue\r
+        b1 = b1 << 1001\r
+        If b1 = 0 Then arr(6) = True\r
+\r
+        b1 = 0\r
+        b1 = b1 << 1001\r
+        If b1 = 0 Then arr(7) = True\r
+\r
+        ' Right shift operator tests\r
+\r
+        Dim c1 As Byte = 5\r
+\r
+        c1 = c1 >> 1001\r
+        If c1 = 2 Then arr(8) = True\r
+\r
+        c1 = Byte.MaxValue\r
+        c1 = c1 >> 2001\r
+        If c1 = 127 Then arr(9) = True\r
+\r
+        c1 = Byte.MinValue\r
+        c1 = c1 >> 2002\r
+        If c1 = 0 Then arr(10) = True\r
+\r
+        Dim d1 As Integer = 5\r
+\r
+        d1 = d1 >> 1001\r
+        If d1 = 0 Then arr(11) = True\r
+\r
+        d1 = -5\r
+        d1 = d1 >> 1001\r
+        If d1 = -1 Then arr(12) = True\r
+\r
+        d1 = Integer.MaxValue\r
+        d1 = d1 >> 1001\r
+        If d1 = 4194303 Then arr(13) = True\r
+\r
+        d1 = Integer.MinValue\r
+        d1 = d1 >> 1001\r
+        If d1 = -4194304 Then arr(14) = True\r
+\r
+        d1 = 0\r
+        d1 = d1 >> 1001\r
+        If d1 = 0 Then arr(15) = True\r
+\r
+        'For i As Integer = 0 To arr.GetUpperBound(0) \r
+        '   Console.WriteLine("{0}: {1}", i, arr(i))\r
+        'Next\r
+\r
+        For Each bval As Boolean In arr\r
+            If Not bval Then\r
+                Return 1\r
+            End If\r
+        Next\r
+\r
+        Return 0\r
+\r
+    End Function\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/ShiftOperatorsA.vb b/mcs/mbas/Test/tests/ShiftOperatorsA.vb
new file mode 100755 (executable)
index 0000000..ae7223f
--- /dev/null
@@ -0,0 +1,13 @@
+\r
+Imports System\r
+\r
+Module ShiftOperatorsA\r
+\r
+    Sub Main()\r
+        Dim a1 As Double = 200.93\r
+        a1 = a1 >> 109.95\r
+        Console.WriteLine(a1)\r
+\r
+    End Sub\r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/SingleLiteral.vb b/mcs/mbas/Test/tests/SingleLiteral.vb
new file mode 100755 (executable)
index 0000000..168afa1
--- /dev/null
@@ -0,0 +1,11 @@
+Imports System
+Module SingleLiteral
+       Sub Main()
+               Try
+                       Dim a As Single=1.23
+                       Dim b As Single=1.23E+10
+               Catch e As Exception
+                       Console.WriteLine(e.Message)
+               End Try
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/SingleLiteralA.vb b/mcs/mbas/Test/tests/SingleLiteralA.vb
new file mode 100755 (executable)
index 0000000..2340388
--- /dev/null
@@ -0,0 +1,31 @@
+Imports System
+Module SingleLiteral
+       Sub Main()
+               Try
+                       Dim a As Single=1.23F
+                       Dim b As Single=1.23E+10F
+                               Dim c As Single=9223372036854775808F
+                       Dim d As Single=.23F
+                       Dim f As Single
+                        If a<>1.23F Then
+                                Console.WriteLine("#A1-SingleLiteralA:Failed")
+                        End If
+                         If b<>1.23E+10F Then
+                                Console.WriteLine("#A2-SingleLiteralA:Failed")
+                        End If
+                         If c<>9.223372E+18F Then
+                                Console.WriteLine("#A3-SingleLiteralA:Failed")
+                        End If
+                       If d<>0.23 Then
+                               Console.WriteLine("#A4-SingleLiteralA:Failed")
+                       End If
+                       If f<>0 Then
+                                Console.WriteLine("#A5-SingleLiteralA:Failed")
+                        End If
+                                                                                  
+                       
+               Catch e As Exception
+                       Console.WriteLine(e.Message)
+               End Try
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/SingleLiteralB.vb b/mcs/mbas/Test/tests/SingleLiteralB.vb
new file mode 100755 (executable)
index 0000000..6063ccf
--- /dev/null
@@ -0,0 +1,15 @@
+Imports System
+Module SingleLiteral
+       Sub Main()
+               Try
+                       Dim a As Single=True
+                       If a<>-1 Then
+                                Console.WriteLine("SingleLiteralB:Failed")
+                        End If
+                                
+                       
+               Catch e As Exception
+                       Console.WriteLine(e.Message)
+               End Try
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/SingleTypeCharTest.vb b/mcs/mbas/Test/tests/SingleTypeCharTest.vb
new file mode 100644 (file)
index 0000000..2326b73
--- /dev/null
@@ -0,0 +1,19 @@
+Imports System
+Module SingleTypeCharTest
+    Sub Main()
+        Try
+            Dim m As Integer
+            m = f(20)
+            If m <> 20 Then
+                Throw New Exception("IntegerTypeChar: failed")
+            End If
+            Exit Sub
+        Catch e As Exception
+            Console.WriteLine(e.Message)
+        End Try
+    End Sub
+
+    Function f!(ByVal param!)
+        f = param
+    End Function
+End Module
diff --git a/mcs/mbas/Test/tests/SingleTypeCharTestA.vb b/mcs/mbas/Test/tests/SingleTypeCharTestA.vb
new file mode 100755 (executable)
index 0000000..f160500
--- /dev/null
@@ -0,0 +1,12 @@
+Module M
+       Sub Main()
+               Dim a!
+               a=10
+
+               Dim b As Single
+               b!=10
+
+               Dim c!
+               c!=10
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/SingleTypeCharTestB.vb b/mcs/mbas/Test/tests/SingleTypeCharTestB.vb
new file mode 100644 (file)
index 0000000..c8f3349
--- /dev/null
@@ -0,0 +1,19 @@
+Imports System
+Module SingleTypeCharTest
+    Sub Main()
+        Try
+            Dim m As Integer
+            m = f(20)
+            If m <> 20 Then
+                Throw New Exception("IntegerTypeChar: failed")
+            End If
+            Exit Sub
+        Catch e As Exception
+            Console.WriteLine(e.Message)
+        End Try
+    End Sub
+
+    Function f!(ByVal param!)
+        f! = param
+    End Function
+End Module
diff --git a/mcs/mbas/Test/tests/SingleTypeCharTestC2.vb b/mcs/mbas/Test/tests/SingleTypeCharTestC2.vb
new file mode 100755 (executable)
index 0000000..253b916
--- /dev/null
@@ -0,0 +1,9 @@
+Module M
+       Sub Main()
+
+               
+               Dim b!
+               b=20R
+
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/StringLiteralTest.vb b/mcs/mbas/Test/tests/StringLiteralTest.vb
new file mode 100755 (executable)
index 0000000..e25c523
--- /dev/null
@@ -0,0 +1,4 @@
+Module StringLiteralTest
+    Sub Main()
+    End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/StringLiterals.vb b/mcs/mbas/Test/tests/StringLiterals.vb
new file mode 100755 (executable)
index 0000000..7d2a62b
--- /dev/null
@@ -0,0 +1,23 @@
+Module StringLiterals\r
+    Sub main()\r
+        Dim s As String\r
+        s = "x"\r
+\r
+        Dim a As String = "xyz"\r
+        a = "xyz1"\r
+\r
+        If a = "xyz1" Then\r
+        End If\r
+\r
+        'Escaped " mark\r
+        ' each "" represents a single " in a string\r
+        a = ("a""b""")\r
+\r
+        Dim x As String = "hi"\r
+        Dim y As String = "hi"\r
+\r
+        If Not x Is y Then\r
+            Throw New System.Exception("x and y are different instances")\r
+        End If\r
+    End Sub\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/StringLiteralsA.vb b/mcs/mbas/Test/tests/StringLiteralsA.vb
new file mode 100755 (executable)
index 0000000..a134bcf
--- /dev/null
@@ -0,0 +1,17 @@
+Imports System
+Module StringLiteral
+       Sub Main()
+               Try
+                       Dim a As String="Hello"
+                       Dim b As String=" World "
+                       Dim c As String=47
+                       Dim d As String=a+b+c
+                       If d<>"Hello World 47" Then
+                               Throw New Exception("StringLiteralA:Failed-String concatenation does not work right")
+                       End If
+               Catch e As Exception
+                       Console.WriteLine(e.Message)
+               End Try
+       
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/StringTypeCharTest.vb b/mcs/mbas/Test/tests/StringTypeCharTest.vb
new file mode 100644 (file)
index 0000000..a481b8d
--- /dev/null
@@ -0,0 +1,19 @@
+Imports System
+Module StringTypeCharTest
+    Sub Main()
+        Try
+            Dim m As String
+            m = f(20)
+            If m <> 20 Then
+                Throw New Exception("StringTypeCharTest: failed")
+            End If
+            Exit Sub
+        Catch e As Exception
+            Console.WriteLine(e.Message)
+        End Try
+    End Sub
+
+    Function f$(ByVal param$)
+        f = param
+    End Function
+End Module
diff --git a/mcs/mbas/Test/tests/StringTypeCharTestA.vb b/mcs/mbas/Test/tests/StringTypeCharTestA.vb
new file mode 100755 (executable)
index 0000000..a85fcca
--- /dev/null
@@ -0,0 +1,12 @@
+Module M
+       Sub Main()
+               Dim a$
+               a="Hello"
+
+               Dim b As String
+               b$="Hello"
+
+               Dim c$
+               c$="Hello"
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/StringTypeCharTestB.vb b/mcs/mbas/Test/tests/StringTypeCharTestB.vb
new file mode 100644 (file)
index 0000000..a2a191f
--- /dev/null
@@ -0,0 +1,19 @@
+Imports System
+Module StringTypeCharTest
+    Sub Main()
+        Try
+            Dim m As String
+            m = f(20)
+            If m <> 20 Then
+                Throw New Exception("StringTypeCharTest: failed")
+            End If
+            Exit Sub
+        Catch e As Exception
+            Console.WriteLine(e.Message)
+        End Try
+    End Sub
+
+    Function f$(ByVal param$)
+        f$ = param
+    End Function
+End Module
diff --git a/mcs/mbas/Test/tests/StringTypeCharTestC2.vb b/mcs/mbas/Test/tests/StringTypeCharTestC2.vb
new file mode 100755 (executable)
index 0000000..38d6d3c
--- /dev/null
@@ -0,0 +1,9 @@
+Module M
+       Sub Main()
+
+               
+               Dim b$
+               b=20D
+
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/StructureA.vb b/mcs/mbas/Test/tests/StructureA.vb
new file mode 100755 (executable)
index 0000000..133b05f
--- /dev/null
@@ -0,0 +1,50 @@
+Imports System
+
+Structure S
+       Dim a as String
+       Const b as integer = 25
+
+       Class c
+       End class
+
+       Function f(l as long) as long
+               f = l
+       End Function
+
+       Structure S1
+               dim g as string
+       End Structure
+
+End Structure
+
+
+Module M
+       Sub Main()
+               dim x as S
+
+               x.a = 10
+               If x.a <> 10 then
+                       Throw new Exception ("#A1, Unexpected result")
+               End If
+
+               dim y as S = x
+
+               x.a = 20
+               If y.a <> 10 then
+                       Throw new Exception ("#A2, Unexpected result")
+               End If
+               If x.a <> 20 then
+                       Throw new Exception ("#A3, Unexpected result")
+               End If
+
+               If x.b <> 25 then
+                       Throw new Exception ("#A4, Unexpected result")
+               End If
+               'Console.WriteLine(x.b)
+
+               If x.f(99) <> 99 then
+                       Throw new Exception ("#A5, Unexpected result")
+               End If
+
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/StructureB.vb b/mcs/mbas/Test/tests/StructureB.vb
new file mode 100755 (executable)
index 0000000..b4f6f74
--- /dev/null
@@ -0,0 +1,16 @@
+Imports System
+
+Structure S
+       Dim a as String
+       Const b as integer = 25
+
+       Sub NEW(l as long)
+       End Sub
+End Structure
+
+
+Module M
+       Sub Main()
+               dim x as S = new S(100)
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/Test2.vb b/mcs/mbas/Test/tests/Test2.vb
new file mode 100755 (executable)
index 0000000..f4a650b
--- /dev/null
@@ -0,0 +1,9 @@
+Imports System
+Module Test
+
+Sub Main()
+       Console.WriteLine ("1st Test")
+End Sub
+
+End Module
+
diff --git a/mcs/mbas/Test/tests/TypeOf.vb b/mcs/mbas/Test/tests/TypeOf.vb
new file mode 100755 (executable)
index 0000000..cdb7a15
--- /dev/null
@@ -0,0 +1,21 @@
+Imports System
+
+Module M
+       Class Test1
+       End Class
+
+        Class Test2
+       End Class
+
+       Sub Main
+               Dim o As Object
+               o = new Test1()
+               If Not TypeOf o Is Test1 Then
+                       Throw New Exception("#A1: TypeOf failed")
+               End If
+               If TypeOf o Is Test2 Then
+                       Throw New Exception("#A2: TypeOf failed")
+               End If
+       End Sub
+End Module
+               
diff --git a/mcs/mbas/Test/tests/Variables.vb b/mcs/mbas/Test/tests/Variables.vb
new file mode 100755 (executable)
index 0000000..e422516
--- /dev/null
@@ -0,0 +1,20 @@
+Imports System\r
+\r
+Module Variables\r
+       Sub Main()\r
+               Dim a As Integer\r
+               If a<>0 Then\r
+                       Throw New Exception("Variables : Failed-Error assigning default value to variables")\r
+               End If\r
+               Dim b 'Default type is Object\r
+               If b<>"" Then\r
+                       Throw New Exception("Variables : Failed-Error in implicit conversion of Object to string")\r
+               End If\r
+               If b<>0 Then\r
+                       Throw New Exception("Variables : Failed-Error in implicit conversion of Object to integer")\r
+               End If\r
+               If b<>0.0 Then\r
+                       Throw New Exception("Variables : Failed-Error in implicit conversion of Object to double")\r
+               End If\r
+       End Sub\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/VariablesA.vb b/mcs/mbas/Test/tests/VariablesA.vb
new file mode 100755 (executable)
index 0000000..a9378f4
--- /dev/null
@@ -0,0 +1,8 @@
+Module Module1\r
+    Dim x As Integer\r
+    Public y As Integer\r
+    Public dim z As Integer\r
+    Sub Main()\r
+\r
+    End Sub\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/VariablesB.vb b/mcs/mbas/Test/tests/VariablesB.vb
new file mode 100755 (executable)
index 0000000..7e23625
--- /dev/null
@@ -0,0 +1,52 @@
+Imports System\r
+\r
+Class cls1\r
+End Class\r
+\r
+Module VariableB\r
+    Dim a As Integer, b As Boolean\r
+    Dim c, d, e As Long\r
+    Dim f As String\r
+    Dim g(5) As Integer\r
+    Dim h(5, 7) As Long\r
+    Dim i As New Integer()\r
+    Dim j(5) As Integer\r
+    Dim k(5) As Integer\r
+    Dim l(5), m(6), n(7) As Integer\r
+    Dim o\r
+    Dim p As New cls1()
+    Dim q%, r&, s@, t!, u#
+    Sub main()
+       If a.GetTypeCode() <> TypeCode.Int32 Then\r
+            Throw New System.Exception("#A1, Type mismatch found")\r
+        End If\r
+        If b.GetTypeCode() <> TypeCode.Boolean Then\r
+            Throw New System.Exception("#A2, Type mismatch found")\r
+        End If\r
+        If c.GetTypeCode() <> TypeCode.Int64 Then\r
+            Throw New System.Exception("#A3, Type mismatch found")\r
+        End If\r
+        If d.GetTypeCode() <> TypeCode.Int64 Then\r
+            Throw New System.Exception("#A4, Type mismatch found")\r
+        End If\r
+        If e.GetTypeCode() <> TypeCode.Int64 Then\r
+            Throw New System.Exception("#A5, Type mismatch found")\r
+        End If\r
+        f = "abc"\r
+        If f.GetTypeCode() <> TypeCode.String Then\r
+            Throw New System.Exception("#A6, Type mismatch found")\r
+        End If\r
+        If i.GetTypeCode() <> TypeCode.Int32 Then\r
+            Throw New System.Exception("#A7, Type mismatch found")\r
+        End If
+       If q.GetTypeCode() <> TypeCode.Int32 Then\r
+            Throw New System.Exception("#A8, Type mismatch found")\r
+        End If
+       If s.GetTypeCode() <> TypeCode.Decimal Then\r
+            Throw New System.Exception("#A9, Type mismatch found")\r
+        End If
+       If u.GetTypeCode() <> TypeCode.Double Then\r
+            Throw New System.Exception("#A10, Type mismatch found")\r
+        End If
+    End Sub\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/VariablesC.vb b/mcs/mbas/Test/tests/VariablesC.vb
new file mode 100755 (executable)
index 0000000..c1ea7f0
--- /dev/null
@@ -0,0 +1,27 @@
+Imports System\r
+\r
+Class cls\r
+End Class\r
+\r
+Module VariableC\r
+    Dim a As Integer = 10\r
+    Dim b As String = "abc"\r
+    Dim c As cls = New cls()\r
+\r
+\r
+    Dim e() As Integer = {1, 2, 3, 4, 5}\r
+\r
+    Sub Main()\r
+       Console.WriteLine(b)\r
+\r
+        If a <> 10 Then\r
+            Throw New Exception("#A1, value mismatch")\r
+        End If\r
+        If b <> "abc" Then\r
+            Throw New Exception("#A2, value mismatch")\r
+        End If\r
+\r
+\r
+\r
+    End Sub\r
+End Module\r
diff --git a/mcs/mbas/Test/tests/VariablesD.vb b/mcs/mbas/Test/tests/VariablesD.vb
new file mode 100755 (executable)
index 0000000..d6b295a
--- /dev/null
@@ -0,0 +1,59 @@
+Imports System
+Class A
+       public shared y as integer = 20
+       public z as integer = 30
+
+       Shared Sub New()
+       End Sub
+
+       public Sub New()
+       End Sub
+
+       Shared function f() as integer
+               return 50
+       end function
+end class
+
+Module M
+       Sub Main()
+               if (A.y <> 20) then
+                       Throw new Exception ("#A1, Unexpected result")
+               end if
+
+               dim c as new A()
+               dim d as new A()
+
+               if(c.y <> 20) then
+                       Throw new Exception ("#A2, Unexpected result")
+               end if
+
+               if(d.y <> 20) then
+                       Throw new Exception ("#A3, Unexpected result")
+               end if
+
+               A.y = 25
+
+               if(c.y <> 25) then
+                       Throw new Exception ("#A4, Unexpected result")
+               end if
+
+               c.y = 35
+
+               if(A.y <> 35) then
+                       Throw new Exception ("#A5, Unexpected result")
+               end if
+
+               if(d.y <> 35) then
+                       Throw new Exception ("#A6, Unexpected result")
+               end if
+
+
+               if(c.z <> 30) then
+                       Throw new Exception ("#A7, Unexpected result")
+               end if
+
+               if(A.f() <> 50) then
+                       Throw new Exception ("#A8, Unexpected result")
+               end if
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/VariablesE.vb b/mcs/mbas/Test/tests/VariablesE.vb
new file mode 100755 (executable)
index 0000000..f3c2118
--- /dev/null
@@ -0,0 +1,14 @@
+Class A
+       public c as integer = 10
+End Class
+
+Class B
+       Inherits A
+
+       public shadows c as integer = 20
+end class
+
+Module M
+       Sub Main()
+       End Sub
+End Module
diff --git a/mcs/mbas/Test/tests/WithStatementA.vb b/mcs/mbas/Test/tests/WithStatementA.vb
new file mode 100755 (executable)
index 0000000..b264474
--- /dev/null
@@ -0,0 +1,35 @@
+Imports System\r
+\r
+Module WithStatementA\r
+    Class C1\r
+        Public a1 As Integer = 10\r
+        Friend a2 As String = "Hello"\r
+        Sub f1()\r
+            Console.WriteLine("Class C1: {0} {1}", a1, a2)\r
+        End Sub\r
+    End Class\r
+\r
+    Sub main()\r
+        Dim a As New C1()\r
+        With a\r
+            .a1 = 20\r
+            .a2 = "Hello World"\r
+            .f1()\r
+            Dim x As New C1()\r
+            x.a1 = 2\r
+            With x\r
+                .a1 = 3\r
+                .a2 = "In nested With statement"\r
+                .f1()\r
+                a.a1 = 25\r
+                a.a2 = "Me too"\r
+                a.f1()\r
+            End With\r
+        End With\r
+\r
+        With a     ' Empty With statement\r
+        End With\r
+\r
+    End Sub\r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/WithStatementB.vb b/mcs/mbas/Test/tests/WithStatementB.vb
new file mode 100755 (executable)
index 0000000..735d7f2
--- /dev/null
@@ -0,0 +1,29 @@
+Imports System\r
+\r
+\r
+Module WithStatementB\r
+    Class C1\r
+        Public a1 As Integer = 10\r
+        Friend a2 As String = "Hello"\r
+        Sub f1()\r
+            Console.WriteLine("Class C1: {0} {1}", a1, a2)\r
+        End Sub\r
+    End Class\r
+\r
+    Sub main()\r
+        Dim a As New C1()\r
+        With a\r
+            a.a1 = 20\r
+            .a2 = "Hello World"\r
+            Dim x As New C1()\r
+            a = x  ' Tried reassiging the object inside With statement\r
+            If .a1 = a.a1 Or .a2 = a.a2 Then\r
+                Throw New Exception("#WS1 - With Statement failed")\r
+            End If\r
+            a.f1()\r
+            .f1()\r
+        End With\r
+\r
+    End Sub\r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/WithStatementC.vb b/mcs/mbas/Test/tests/WithStatementC.vb
new file mode 100755 (executable)
index 0000000..e2be991
--- /dev/null
@@ -0,0 +1,33 @@
+Imports System\r
+\r
+Module WithStatementC\r
+    Class C1\r
+        Public a1 As Integer = 10\r
+        Public a2 As String = "Hello"\r
+        Sub f1()\r
+            Console.WriteLine("Class C1: {0} {1}", a1, a2)\r
+        End Sub\r
+    End Class\r
+\r
+    Sub Main()\r
+        Dim a As New C1()\r
+        With a\r
+            .a2 = "Hello World"\r
+            GoTo labelA\r
+            ' Exit before all statements in With have been executed  \r
+            .a1 = 20\r
+            Dim x As New C1()\r
+            a = x\r
+            If .a1 = a.a1 Or .a2 = a.a2 Then\r
+                Throw New Exception("#WS1 - With Statement failed")\r
+            End If\r
+            a.f1()\r
+            .f1()\r
+labelA:\r
+        End With\r
+        If a.a1 = 20 Then\r
+            Throw New Exception("#WS2- Exit from With Statement failed")\r
+        End If\r
+    End Sub\r
+\r
+End Module
\ No newline at end of file
diff --git a/mcs/mbas/Test/tests/misc2.vb b/mcs/mbas/Test/tests/misc2.vb
new file mode 100755 (executable)
index 0000000..0780170
--- /dev/null
@@ -0,0 +1,7 @@
+module misc2
+
+sub Main()
+       System.Console.WriteLine ("Misc2")
+end sub
+
+end module\r