OSDN Git Service

* gnat.dg/stack_usage1.adb: New test.
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Jan 2012 08:36:31 +0000 (08:36 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Jan 2012 08:36:31 +0000 (08:36 +0000)
* gnat.dg/stack_usage1_pkg.ad[sb]: New helper.

* gcc.dg/pr44194-1.c: Remove superfluous include directive.
* gcc.dg/pr44194-2.c: Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183604 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr44194-1.c
gcc/testsuite/gcc.dg/pr44194-2.c
gcc/testsuite/gnat.dg/stack_usage1.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/stack_usage1_pkg.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/stack_usage1_pkg.ads [new file with mode: 0644]

index f24d26f..572378b 100644 (file)
@@ -1,3 +1,11 @@
+2012-01-27  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/stack_usage1.adb: New test.
+       * gnat.dg/stack_usage1_pkg.ad[sb]: New helper.
+
+       * gcc.dg/pr44194-1.c: Remove superfluous include directive.
+       * gcc.dg/pr44194-2.c: Likewise.
+
 2012-01-26  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/51370
index df042cd..d251bf1 100644 (file)
@@ -3,8 +3,6 @@
 /* Restricting to 64-bit targets since 32-bit targets return
    structures in memory.  */
 
-#include <stdint.h>
-
 struct ints { int a, b, c; } foo();
 void bar(int a, int b);
 
index 3548542..b127e1b 100644 (file)
@@ -1,6 +1,5 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -fdump-rtl-dse1" } */
-#include <stdint.h>
 
 struct ints { int a, b, c; } foo();
 void bar(int a, int b);
diff --git a/gcc/testsuite/gnat.dg/stack_usage1.adb b/gcc/testsuite/gnat.dg/stack_usage1.adb
new file mode 100644 (file)
index 0000000..81c0a08
--- /dev/null
@@ -0,0 +1,39 @@
+-- { dg-do compile }
+-- { dg-options "-fstack-usage" }
+
+with Stack_Usage1_Pkg; use Stack_Usage1_Pkg;
+
+procedure Stack_Usage1 is
+
+   A : Integer := Ident_Int (123);
+
+begin
+   case A is
+       when 0 =>
+          My_Proc (R'(Ident_Int(0), Ident_Int(1), Ident_Int(2), Ident_Int(3), Ident_Int(4), Ident_Int(5), Ident_Int(6), Ident_Int(7), Ident_Int(8), Ident_Int(9)));
+       when 1 =>
+          My_Proc (R'(Ident_Int(0), Ident_Int(1), Ident_Int(2), Ident_Int(3), Ident_Int(4), Ident_Int(5), Ident_Int(6), Ident_Int(7), Ident_Int(8), Ident_Int(9)));
+       when 2 =>
+          My_Proc (R'(Ident_Int(0), Ident_Int(1), Ident_Int(2), Ident_Int(3), Ident_Int(4), Ident_Int(5), Ident_Int(6), Ident_Int(7), Ident_Int(8), Ident_Int(9)));
+       when 3 =>
+          My_Proc (R'(Ident_Int(0), Ident_Int(1), Ident_Int(2), Ident_Int(3), Ident_Int(4), Ident_Int(5), Ident_Int(6), Ident_Int(7), Ident_Int(8), Ident_Int(9)));
+       when 4 =>
+          My_Proc (R'(Ident_Int(0), Ident_Int(1), Ident_Int(2), Ident_Int(3), Ident_Int(4), Ident_Int(5), Ident_Int(6), Ident_Int(7), Ident_Int(8), Ident_Int(9)));
+       when 5 =>
+          My_Proc (R'(Ident_Int(0), Ident_Int(1), Ident_Int(2), Ident_Int(3), Ident_Int(4), Ident_Int(5), Ident_Int(6), Ident_Int(7), Ident_Int(8), Ident_Int(9)));
+       when 6 =>
+          My_Proc (R'(Ident_Int(0), Ident_Int(1), Ident_Int(2), Ident_Int(3), Ident_Int(4), Ident_Int(5), Ident_Int(6), Ident_Int(7), Ident_Int(8), Ident_Int(9)));
+       when 7 =>
+          My_Proc (R'(Ident_Int(0), Ident_Int(1), Ident_Int(2), Ident_Int(3), Ident_Int(4), Ident_Int(5), Ident_Int(6), Ident_Int(7), Ident_Int(8), Ident_Int(9)));
+       when 8 =>
+          My_Proc (R'(Ident_Int(0), Ident_Int(1), Ident_Int(2), Ident_Int(3), Ident_Int(4), Ident_Int(5), Ident_Int(6), Ident_Int(7), Ident_Int(8), Ident_Int(9)));
+       when 9 =>
+          My_Proc (R'(Ident_Int(0), Ident_Int(1), Ident_Int(2), Ident_Int(3), Ident_Int(4), Ident_Int(5), Ident_Int(6), Ident_Int(7), Ident_Int(8), Ident_Int(9)));
+       when others =>
+          null;
+   end case;
+
+end Stack_Usage1;
+
+-- { dg-final { scan-stack-usage "\t\[0-9\]\[0-9\]\t" { target i?86-*-* x86_64-*-* } } }
+-- { dg-final { cleanup-stack-usage } }
diff --git a/gcc/testsuite/gnat.dg/stack_usage1_pkg.adb b/gcc/testsuite/gnat.dg/stack_usage1_pkg.adb
new file mode 100644 (file)
index 0000000..1538b85
--- /dev/null
@@ -0,0 +1,13 @@
+package body Stack_Usage1_Pkg is
+
+   function Ident_Int (X : Integer) return Integer is
+   begin
+      return X;
+   end Ident_Int;
+
+   procedure My_Proc (X : R) is
+   begin
+      null;
+   end My_Proc;
+
+end Stack_Usage1_Pkg;
diff --git a/gcc/testsuite/gnat.dg/stack_usage1_pkg.ads b/gcc/testsuite/gnat.dg/stack_usage1_pkg.ads
new file mode 100644 (file)
index 0000000..dbe4dae
--- /dev/null
@@ -0,0 +1,12 @@
+package Stack_Usage1_Pkg is
+
+   function Ident_Int (X : Integer) return Integer;
+
+   type R is
+       record
+          C0, C1, C2, C3, C4, C5, C6, C7, C8, C9 : Integer;
+       end record;
+
+   procedure My_Proc (X : R);
+
+end Stack_Usage1_Pkg;