aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2025-01-07 13:54:17 -0700
committerTom Tromey <tromey@adacore.com>2025-01-10 09:05:04 -0700
commitf0547c88fa7cb9a874d27e4a268a9ef2f40d8816 (patch)
treea989c8759a99146208ee41f5aa52fee83f030a3a
parent07492186894c3eda4242e9994fc5e973b8f3fb0b (diff)
downloadbinutils-f0547c88fa7cb9a874d27e4a268a9ef2f40d8816.zip
binutils-f0547c88fa7cb9a874d27e4a268a9ef2f40d8816.tar.gz
binutils-f0547c88fa7cb9a874d27e4a268a9ef2f40d8816.tar.bz2
Minor test case updates for gnat-llvm
gnat-llvm seems to be a bit more aggressive about eliminating unused variables. This patch improves the test results a tiny bit by arranging for some variables to appear to be used. Note the copyright dates on the new files are done that way because I simply copied existing files.
-rw-r--r--gdb/testsuite/gdb.ada/discrete-char/main.adb4
-rw-r--r--gdb/testsuite/gdb.ada/discrete-char/pck.adb21
-rw-r--r--gdb/testsuite/gdb.ada/discrete-char/pck.ads19
-rw-r--r--gdb/testsuite/gdb.ada/float-bits/pck.adb21
-rw-r--r--gdb/testsuite/gdb.ada/float-bits/pck.ads19
-rw-r--r--gdb/testsuite/gdb.ada/float-bits/prog.adb6
-rw-r--r--gdb/testsuite/gdb.ada/multiarray/p.adb2
-rw-r--r--gdb/testsuite/gdb.ada/multiarray/pack.adb21
-rw-r--r--gdb/testsuite/gdb.ada/multiarray/pack.ads3
-rw-r--r--gdb/testsuite/gdb.ada/packed_record/pck.adb21
-rw-r--r--gdb/testsuite/gdb.ada/packed_record/pck.ads19
-rw-r--r--gdb/testsuite/gdb.ada/packed_record/pr.adb3
12 files changed, 156 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.ada/discrete-char/main.adb b/gdb/testsuite/gdb.ada/discrete-char/main.adb
index 4717387..4851a58 100644
--- a/gdb/testsuite/gdb.ada/discrete-char/main.adb
+++ b/gdb/testsuite/gdb.ada/discrete-char/main.adb
@@ -13,11 +13,13 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+with Pck; use Pck;
+
procedure Main is
type Letters is new Character range 'A' .. 'Z';
type Array_Type is array (Letters) of Boolean;
Array_Value : Array_Type := ('A' => true, 'Z' => true, others => false);
begin
- null; -- STOP
+ Do_Nothing (Array_Value'Address); -- STOP
end Main;
diff --git a/gdb/testsuite/gdb.ada/discrete-char/pck.adb b/gdb/testsuite/gdb.ada/discrete-char/pck.adb
new file mode 100644
index 0000000..a175b7b
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/discrete-char/pck.adb
@@ -0,0 +1,21 @@
+-- Copyright 2014-2024 Free Software Foundation, Inc.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+package body Pck is
+ procedure Do_Nothing (A : System.Address) is
+ begin
+ null;
+ end Do_Nothing;
+end Pck;
diff --git a/gdb/testsuite/gdb.ada/discrete-char/pck.ads b/gdb/testsuite/gdb.ada/discrete-char/pck.ads
new file mode 100644
index 0000000..384bf08
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/discrete-char/pck.ads
@@ -0,0 +1,19 @@
+-- Copyright 2014-2024 Free Software Foundation, Inc.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+with System;
+package Pck is
+ procedure Do_Nothing (A : System.Address);
+end Pck;
diff --git a/gdb/testsuite/gdb.ada/float-bits/pck.adb b/gdb/testsuite/gdb.ada/float-bits/pck.adb
new file mode 100644
index 0000000..a175b7b
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/float-bits/pck.adb
@@ -0,0 +1,21 @@
+-- Copyright 2014-2024 Free Software Foundation, Inc.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+package body Pck is
+ procedure Do_Nothing (A : System.Address) is
+ begin
+ null;
+ end Do_Nothing;
+end Pck;
diff --git a/gdb/testsuite/gdb.ada/float-bits/pck.ads b/gdb/testsuite/gdb.ada/float-bits/pck.ads
new file mode 100644
index 0000000..384bf08
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/float-bits/pck.ads
@@ -0,0 +1,19 @@
+-- Copyright 2014-2024 Free Software Foundation, Inc.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+with System;
+package Pck is
+ procedure Do_Nothing (A : System.Address);
+end Pck;
diff --git a/gdb/testsuite/gdb.ada/float-bits/prog.adb b/gdb/testsuite/gdb.ada/float-bits/prog.adb
index 8a91b6e..21a2ae4 100644
--- a/gdb/testsuite/gdb.ada/float-bits/prog.adb
+++ b/gdb/testsuite/gdb.ada/float-bits/prog.adb
@@ -13,10 +13,14 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+with Pck; use Pck;
+
procedure Prog is
Val_Float : Float := 23.0;
Val_Double : Long_Float := -2.0e-19;
Val_Long_Double : Long_Long_Float := 5.0e+25;
begin
- null; -- BREAK
+ Do_Nothing (Val_Float'Address); -- BREAK
+ Do_Nothing (Val_Double'Address);
+ Do_Nothing (Val_Long_Double'Address);
end Prog;
diff --git a/gdb/testsuite/gdb.ada/multiarray/p.adb b/gdb/testsuite/gdb.ada/multiarray/p.adb
index 3880ad6..ca568be 100644
--- a/gdb/testsuite/gdb.ada/multiarray/p.adb
+++ b/gdb/testsuite/gdb.ada/multiarray/p.adb
@@ -42,5 +42,7 @@ begin
Nop; -- START
Discard (Simple, Nested);
+ Do_Nothing (Simple'Address);
+ Do_Nothing (Nested'Address);
end P;
diff --git a/gdb/testsuite/gdb.ada/multiarray/pack.adb b/gdb/testsuite/gdb.ada/multiarray/pack.adb
new file mode 100644
index 0000000..767221f
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/multiarray/pack.adb
@@ -0,0 +1,21 @@
+-- Copyright 2024 Free Software Foundation, Inc.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+package body Pack is
+ procedure Do_Nothing (A : System.Address) is
+ begin
+ null;
+ end Do_Nothing;
+end Pack;
diff --git a/gdb/testsuite/gdb.ada/multiarray/pack.ads b/gdb/testsuite/gdb.ada/multiarray/pack.ads
index 38ceb71..f6f0ca1 100644
--- a/gdb/testsuite/gdb.ada/multiarray/pack.ads
+++ b/gdb/testsuite/gdb.ada/multiarray/pack.ads
@@ -13,6 +13,7 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+with System;
package Pack is
type Index_Type_1 is new Natural;
@@ -31,4 +32,6 @@ package Pack is
array (Index_Type_1 range <>, Index_Type_2 range <>)
of CA_Simple_Type;
+ procedure Do_Nothing (A : System.Address);
+
end Pack;
diff --git a/gdb/testsuite/gdb.ada/packed_record/pck.adb b/gdb/testsuite/gdb.ada/packed_record/pck.adb
new file mode 100644
index 0000000..a175b7b
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/packed_record/pck.adb
@@ -0,0 +1,21 @@
+-- Copyright 2014-2024 Free Software Foundation, Inc.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+package body Pck is
+ procedure Do_Nothing (A : System.Address) is
+ begin
+ null;
+ end Do_Nothing;
+end Pck;
diff --git a/gdb/testsuite/gdb.ada/packed_record/pck.ads b/gdb/testsuite/gdb.ada/packed_record/pck.ads
new file mode 100644
index 0000000..384bf08
--- /dev/null
+++ b/gdb/testsuite/gdb.ada/packed_record/pck.ads
@@ -0,0 +1,19 @@
+-- Copyright 2014-2024 Free Software Foundation, Inc.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+with System;
+package Pck is
+ procedure Do_Nothing (A : System.Address);
+end Pck;
diff --git a/gdb/testsuite/gdb.ada/packed_record/pr.adb b/gdb/testsuite/gdb.ada/packed_record/pr.adb
index 4dd41fa..621ee1e 100644
--- a/gdb/testsuite/gdb.ada/packed_record/pr.adb
+++ b/gdb/testsuite/gdb.ada/packed_record/pr.adb
@@ -13,6 +13,7 @@
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+with Pck; use Pck;
procedure pr is
type Report is (Hello, Goodbye);
@@ -30,6 +31,6 @@ procedure pr is
begin
- null; -- STOP
+ Do_Nothing(Var'Address); -- STOP
end pr;