]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Minor test case updates for gnat-llvm
authorTom Tromey <tromey@adacore.com>
Tue, 7 Jan 2025 20:54:17 +0000 (13:54 -0700)
committerTom Tromey <tromey@adacore.com>
Fri, 10 Jan 2025 16:05:04 +0000 (09:05 -0700)
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.

12 files changed:
gdb/testsuite/gdb.ada/discrete-char/main.adb
gdb/testsuite/gdb.ada/discrete-char/pck.adb [new file with mode: 0644]
gdb/testsuite/gdb.ada/discrete-char/pck.ads [new file with mode: 0644]
gdb/testsuite/gdb.ada/float-bits/pck.adb [new file with mode: 0644]
gdb/testsuite/gdb.ada/float-bits/pck.ads [new file with mode: 0644]
gdb/testsuite/gdb.ada/float-bits/prog.adb
gdb/testsuite/gdb.ada/multiarray/p.adb
gdb/testsuite/gdb.ada/multiarray/pack.adb [new file with mode: 0644]
gdb/testsuite/gdb.ada/multiarray/pack.ads
gdb/testsuite/gdb.ada/packed_record/pck.adb [new file with mode: 0644]
gdb/testsuite/gdb.ada/packed_record/pck.ads [new file with mode: 0644]
gdb/testsuite/gdb.ada/packed_record/pr.adb

index 4717387ffbc77cc73d9310a80e59c7d5ab9ba500..4851a58b1ce3634471c92b09c25edb1ea340ddb0 100644 (file)
 --  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 (file)
index 0000000..a175b7b
--- /dev/null
@@ -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 (file)
index 0000000..384bf08
--- /dev/null
@@ -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 (file)
index 0000000..a175b7b
--- /dev/null
@@ -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 (file)
index 0000000..384bf08
--- /dev/null
@@ -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;
index 8a91b6e735961253211caac15db9a76092ffea90..21a2ae4b0b4b1cf360cc3e24829d403446771c35 100644 (file)
 --  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;
index 3880ad63dd4fe5c6dcacca6b89dfe91876f278eb..ca568be586927385364d10f4e0eaeb0618700e99 100644 (file)
@@ -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 (file)
index 0000000..767221f
--- /dev/null
@@ -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;
index 38ceb71d0e34ad6a65b3368e0346f57532dd4f44..f6f0ca1880b45df124413294f7476b97d9460037 100644 (file)
@@ -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 (file)
index 0000000..a175b7b
--- /dev/null
@@ -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 (file)
index 0000000..384bf08
--- /dev/null
@@ -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;
index 4dd41fa3fbe509570632dd0db9942078a32722e7..621ee1e66e7393f87b26e7f03fde0782eebb6a62 100644 (file)
@@ -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;