aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gnat.dg')
-rw-r--r--gcc/testsuite/gnat.dg/gcov/gcov.exp15
-rw-r--r--gcc/testsuite/gnat.dg/lto29.adb9
-rw-r--r--gcc/testsuite/gnat.dg/lto29_pkg.ads15
-rw-r--r--gcc/testsuite/gnat.dg/opt105.adb30
-rw-r--r--gcc/testsuite/gnat.dg/opt105_pkg.adb6
-rw-r--r--gcc/testsuite/gnat.dg/opt105_pkg.ads11
-rw-r--r--gcc/testsuite/gnat.dg/renaming17.adb17
7 files changed, 99 insertions, 4 deletions
diff --git a/gcc/testsuite/gnat.dg/gcov/gcov.exp b/gcc/testsuite/gnat.dg/gcov/gcov.exp
index 4fa887d..031914a 100644
--- a/gcc/testsuite/gnat.dg/gcov/gcov.exp
+++ b/gcc/testsuite/gnat.dg/gcov/gcov.exp
@@ -21,12 +21,19 @@ load_lib gnat-dg.exp
load_lib gcov.exp
global GCC_UNDER_TEST
+global GCOV_UNDER_TEST
-# For now find gcov in the same directory as $GCC_UNDER_TEST.
-if { ![is_remote host] && [string match "*/*" [lindex $GCC_UNDER_TEST 0]] } {
- set GCOV [file dirname [lindex $GCC_UNDER_TEST 0]]/gcov
+# For now find gcov in the same directory as $GCC_UNDER_TEST, unless
+# GCOV_UNDER_TEST is defined.
+
+if ![info exists GCOV_UNDER_TEST] {
+ if { ![is_remote host] && [string match "*/*" [lindex $GCC_UNDER_TEST 0]] } {
+ set GCOV [file dirname [lindex $GCC_UNDER_TEST 0]]/gcov
+ } else {
+ set GCOV gcov
+ }
} else {
- set GCOV gcov
+ set GCOV $GCOV_UNDER_TEST
}
# Initialize harness.
diff --git a/gcc/testsuite/gnat.dg/lto29.adb b/gcc/testsuite/gnat.dg/lto29.adb
new file mode 100644
index 0000000..44f556f
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/lto29.adb
@@ -0,0 +1,9 @@
+-- { dg-do run }
+-- { dg-options "-O -flto" { target lto } }
+
+with Lto29_Pkg;
+
+procedure Lto29 is
+begin
+ null;
+end;
diff --git a/gcc/testsuite/gnat.dg/lto29_pkg.ads b/gcc/testsuite/gnat.dg/lto29_pkg.ads
new file mode 100644
index 0000000..6008dc5
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/lto29_pkg.ads
@@ -0,0 +1,15 @@
+with Ada.Strings.Bounded;
+
+package Lto29_Pkg is
+
+ package M is new Ada.Strings.Bounded.Generic_Bounded_Length (10);
+
+ type T is new M.Bounded_String;
+
+ Null_T : constant T;
+
+private
+
+ Null_T : constant T := To_Bounded_String ("");
+
+end Lto29_Pkg;
diff --git a/gcc/testsuite/gnat.dg/opt105.adb b/gcc/testsuite/gnat.dg/opt105.adb
new file mode 100644
index 0000000..eb2c197
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt105.adb
@@ -0,0 +1,30 @@
+-- { dg-do run }
+-- { dg-options "-O" }
+
+with Opt105_Pkg; use Opt105_Pkg;
+
+procedure Opt105 is
+
+ Val : constant Enum :=
+ (if Enabled then (if Disabled then Two else One) else Three);
+
+begin
+ if Cond1 then
+ return;
+ end if;
+
+ if Cond2 then
+ return;
+ end if;
+
+ case Val is
+ when One =>
+ raise Program_Error;
+
+ when Two =>
+ raise Constraint_Error;
+
+ when Three =>
+ null;
+ end case;
+end;
diff --git a/gcc/testsuite/gnat.dg/opt105_pkg.adb b/gcc/testsuite/gnat.dg/opt105_pkg.adb
new file mode 100644
index 0000000..e00de94
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt105_pkg.adb
@@ -0,0 +1,6 @@
+package body Opt105_Pkg is
+
+ function Cond1 return Boolean is (False);
+ function Cond2 return Boolean is (False);
+
+end Opt105_Pkg;
diff --git a/gcc/testsuite/gnat.dg/opt105_pkg.ads b/gcc/testsuite/gnat.dg/opt105_pkg.ads
new file mode 100644
index 0000000..2b373b7
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/opt105_pkg.ads
@@ -0,0 +1,11 @@
+package Opt105_Pkg is
+
+ type Enum is (One, Two, Three);
+
+ Enabled : Boolean := False;
+ Disabled : Boolean := False;
+
+ function Cond1 return Boolean;
+ function Cond2 return Boolean;
+
+end Opt105_Pkg;
diff --git a/gcc/testsuite/gnat.dg/renaming17.adb b/gcc/testsuite/gnat.dg/renaming17.adb
new file mode 100644
index 0000000..d826433
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/renaming17.adb
@@ -0,0 +1,17 @@
+-- { dg-do run }
+
+procedure Renaming17 is
+
+ function Incr (V : Integer; I : Integer := 1) return Integer is
+ (V + I);
+
+ function Incr_Ren (V : Integer; I : Positive := 1) return Positive
+ renames Incr;
+
+ I : Integer;
+
+begin
+ I := Incr_Ren (-3);
+ I := Incr_Ren (-3, 2);
+ I := Incr_Ren (-3, 0);
+end;