Update copyright year range in all GDB files
[external/binutils.git] / gdb / testsuite / gdb.ada / operator_bp / ops.adb
1 --  Copyright 2012-2018 Free Software Foundation, Inc.
2 --
3 --  This program is free software; you can redistribute it and/or modify
4 --  it under the terms of the GNU General Public License as published by
5 --  the Free Software Foundation; either version 3 of the License, or
6 --  (at your option) any later version.
7 --
8 --  This program is distributed in the hope that it will be useful,
9 --  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 --  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 --  GNU General Public License for more details.
12 --
13 --  You should have received a copy of the GNU General Public License
14 --  along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
16 package body Ops is
17
18    function Make (X: Natural) return Int is
19    begin
20       return Int (X);
21    end Make;
22
23    function "+" (I1, I2 : Int) return Int is
24    begin
25       return Int (IntRep (I1) + IntRep (I2));
26    end;
27
28    function "-" (I1, I2 : Int) return Int is
29    begin
30       return Int (IntRep (I1) - IntRep (I2));
31    end;
32
33    function "*" (I1, I2 : Int) return Int is
34    begin
35       return Int (IntRep (I1) * IntRep (I2));
36    end;
37
38    function "/" (I1, I2 : Int) return Int is
39    begin
40       return Int (IntRep (I1) / IntRep (I2));
41    end;
42
43    function "mod" (I1, I2 : Int) return Int is
44    begin
45       return Int (IntRep (I1) mod IntRep (I2));
46    end;
47
48    function "rem" (I1, I2 : Int) return Int is
49    begin
50       return Int (IntRep (I1) rem IntRep (I2));
51    end;
52
53    function "**" (I1, I2 : Int) return Int is
54       Result : IntRep := 1;
55    begin
56       for J in 1 .. IntRep (I2) loop
57          Result := IntRep (I1) * Result;
58       end loop;
59       return Int (Result);
60    end;
61
62    function "<" (I1, I2 : Int) return Boolean is
63    begin
64       return IntRep (I1) < IntRep (I2);
65    end;
66
67    function "<=" (I1, I2 : Int) return Boolean is
68    begin
69       return IntRep (I1) <= IntRep (I2);
70    end;
71
72    function ">" (I1, I2 : Int) return Boolean is
73    begin
74       return IntRep (I1) > IntRep (I2);
75    end;
76
77    function ">=" (I1, I2 : Int) return Boolean is
78    begin
79       return IntRep (I1) >= IntRep (I2);
80    end;
81
82    function "=" (I1, I2 : Int) return Boolean is
83    begin
84       return IntRep (I1) = IntRep (I2);
85    end;
86
87    function "and" (I1, I2 : Int) return Int is
88    begin
89       return Int (IntRep (I1) and IntRep (I2));
90    end;
91
92    function "or" (I1, I2 : Int) return Int is
93    begin
94       return Int (IntRep (I1) or IntRep (I2));
95    end;
96
97    function "xor" (I1, I2 : Int) return Int is
98    begin
99       return Int (IntRep (I1) xor IntRep (I2));
100    end;
101
102    function "&" (I1, I2 : Int) return Int is
103    begin
104       return Int (IntRep (I1) and IntRep (I2));
105    end;
106
107    function "abs" (I1 : Int) return Int is
108    begin
109       return Int (abs IntRep (I1));
110    end;
111
112    function "not" (I1 : Int) return Int is
113    begin
114       return Int (not IntRep (I1));
115    end;
116
117    function "+" (I1 : Int) return Int is
118    begin
119       return Int (IntRep (I1));
120    end;
121
122    function "-" (I1 : Int) return Int is
123    begin
124       return Int (-IntRep (I1));
125    end;
126
127    procedure Dummy (I1 : Int) is
128    begin
129       null;
130    end Dummy;
131
132    procedure Dummy (B1 : Boolean) is
133    begin
134       null;
135    end Dummy;
136
137 end Ops;
138
139
140