move ada tests
authorChris Lattner <sabre@nondot.org>
Tue, 3 Apr 2007 21:46:22 +0000 (21:46 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 3 Apr 2007 21:46:22 +0000 (21:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35629 91177308-0d34-0410-b5e6-96231b3b80d8

14 files changed:
test/FrontendAda/array_constructor.adb [new file with mode: 0644]
test/FrontendAda/array_range_ref.adb [new file with mode: 0644]
test/FrontendAda/array_ref.adb [new file with mode: 0644]
test/FrontendAda/array_size.adb [new file with mode: 0644]
test/FrontendAda/emit_var.ads [new file with mode: 0644]
test/FrontendAda/fat_fields.adb [new file with mode: 0644]
test/FrontendAda/fat_fields.ads [new file with mode: 0644]
test/FrontendAda/non_lvalue.adb [new file with mode: 0644]
test/FrontendAda/non_lvalue.ads [new file with mode: 0644]
test/FrontendAda/switch.adb [new file with mode: 0644]
test/FrontendAda/var_size.adb [new file with mode: 0644]
test/FrontendAda/var_size.ads [new file with mode: 0644]
test/FrontendAda/vce.adb [new file with mode: 0644]
test/FrontendAda/vce_lv.adb [new file with mode: 0644]

diff --git a/test/FrontendAda/array_constructor.adb b/test/FrontendAda/array_constructor.adb
new file mode 100644 (file)
index 0000000..d75b8e0
--- /dev/null
@@ -0,0 +1,6 @@
+-- RUN: %llvmgcc -c %s -o /dev/null
+procedure Array_Constructor is
+   A : array (Integer range <>) of Boolean := (True, False);
+begin
+   null;
+end;
diff --git a/test/FrontendAda/array_range_ref.adb b/test/FrontendAda/array_range_ref.adb
new file mode 100644 (file)
index 0000000..f7cba01
--- /dev/null
@@ -0,0 +1,7 @@
+-- RUN: %llvmgcc -c %s -o /dev/null
+procedure Array_Range_Ref is
+   A : String (1 .. 3);
+   B : String := A (A'RANGE)(1 .. 3);
+begin
+   null;
+end;
diff --git a/test/FrontendAda/array_ref.adb b/test/FrontendAda/array_ref.adb
new file mode 100644 (file)
index 0000000..093233a
--- /dev/null
@@ -0,0 +1,11 @@
+-- RUN: %llvmgcc -c %s -o /dev/null
+procedure Array_Ref is
+   type A is array (Natural range <>, Natural range <>) of Boolean;
+   type A_Access is access A;
+   function Get (X : A_Access) return Boolean is
+   begin
+      return X (0, 0);
+   end;
+begin
+   null;
+end;
diff --git a/test/FrontendAda/array_size.adb b/test/FrontendAda/array_size.adb
new file mode 100644 (file)
index 0000000..da4c589
--- /dev/null
@@ -0,0 +1,10 @@
+-- RUN: %llvmgcc -c %s -o /dev/null
+procedure Array_Size is
+   subtype S is String (1 .. 2);
+   type R is record
+      A : S;
+   end record;
+   X : R;
+begin
+   null;
+end;
diff --git a/test/FrontendAda/emit_var.ads b/test/FrontendAda/emit_var.ads
new file mode 100644 (file)
index 0000000..b8d5f8f
--- /dev/null
@@ -0,0 +1,5 @@
+-- RUN: %llvmgcc -c %s -o /dev/null
+with Ada.Finalization;
+package Emit_Var is
+   type Search_Type is new Ada.Finalization.Controlled with null record;
+end;
diff --git a/test/FrontendAda/fat_fields.adb b/test/FrontendAda/fat_fields.adb
new file mode 100644 (file)
index 0000000..906e34e
--- /dev/null
@@ -0,0 +1,10 @@
+-- RUN: %llvmgcc -c %s -o /dev/null
+-- RUN: %llvmgcc -c %s -O2 -o /dev/null
+package body Fat_Fields is
+   procedure Proc is
+   begin
+      if P = null then
+         null;
+      end if;
+   end;
+end;
diff --git a/test/FrontendAda/fat_fields.ads b/test/FrontendAda/fat_fields.ads
new file mode 100644 (file)
index 0000000..d3eab3e
--- /dev/null
@@ -0,0 +1,6 @@
+package Fat_Fields is
+   pragma Elaborate_Body;
+   type A is array (Positive range <>) of Boolean;
+   type A_Ptr is access A;
+   P : A_Ptr := null;
+end;
diff --git a/test/FrontendAda/non_lvalue.adb b/test/FrontendAda/non_lvalue.adb
new file mode 100644 (file)
index 0000000..2a92e52
--- /dev/null
@@ -0,0 +1,7 @@
+-- RUN: %llvmgcc -c %s -o /dev/null
+package body Non_LValue is
+   function A (Y : U) return String is
+   begin
+      return Y.X.B;
+   end;
+end;
diff --git a/test/FrontendAda/non_lvalue.ads b/test/FrontendAda/non_lvalue.ads
new file mode 100644 (file)
index 0000000..7d4eeed
--- /dev/null
@@ -0,0 +1,11 @@
+package Non_LValue is
+   type T (Length : Natural) is record
+      A : String (1 .. Length);
+      B : String (1 .. Length);
+   end record;
+   type T_Ptr is access all T;
+   type U is record
+      X : T_Ptr;
+   end record;
+   function A (Y : U) return String;
+end;
diff --git a/test/FrontendAda/switch.adb b/test/FrontendAda/switch.adb
new file mode 100644 (file)
index 0000000..0eb20b2
--- /dev/null
@@ -0,0 +1,12 @@
+-- RUN: %llvmgcc -c %s -o /dev/null
+function Switch (N : Integer) return Integer is
+begin
+   case N is
+      when Integer'First .. -1 =>
+         return -1;
+      when 0 =>
+         return 0;
+      when others =>
+         return 1;
+   end case;
+end;
diff --git a/test/FrontendAda/var_size.adb b/test/FrontendAda/var_size.adb
new file mode 100644 (file)
index 0000000..2b4d499
--- /dev/null
@@ -0,0 +1,7 @@
+-- RUN: %llvmgcc -c %s -o /dev/null
+package body Var_Size is
+   function A (X : T) return String is
+   begin
+      return X.A;
+   end;
+end;
diff --git a/test/FrontendAda/var_size.ads b/test/FrontendAda/var_size.ads
new file mode 100644 (file)
index 0000000..6a570cb
--- /dev/null
@@ -0,0 +1,7 @@
+package Var_Size is
+   type T (Length : Natural) is record
+      A : String (1 .. Length);
+      B : String (1 .. Length);
+   end record;
+   function A (X : T) return String;
+end;
diff --git a/test/FrontendAda/vce.adb b/test/FrontendAda/vce.adb
new file mode 100644 (file)
index 0000000..3d783d0
--- /dev/null
@@ -0,0 +1,7 @@
+-- RUN: %llvmgcc -c %s -o /dev/null
+procedure VCE is
+  S : String (1 .. 2);
+  B : Character := 'B';
+begin
+  S := 'A' & B;
+end;
diff --git a/test/FrontendAda/vce_lv.adb b/test/FrontendAda/vce_lv.adb
new file mode 100644 (file)
index 0000000..5242b15
--- /dev/null
@@ -0,0 +1,9 @@
+-- RUN: %llvmgcc -c %s -o /dev/null
+procedure VCE_LV is
+   type P is access String ;
+   type T is new P (5 .. 7);
+   subtype U is String (5 .. 7);
+   X : T := new U'(others => 'A');
+begin
+   null;
+end;