1132451Sroberto`/* Implementation of the SUM intrinsic
2132451Sroberto   Copyright (C) 2002-2022 Free Software Foundation, Inc.
3132451Sroberto   Contributed by Paul Brook <paul@nowt.org>
4132451Sroberto
5182007SrobertoThis file is part of the GNU Fortran 95 runtime library (libgfortran).
6182007Sroberto
7182007SrobertoLibgfortran is free software; you can redistribute it and/or
8182007Srobertomodify it under the terms of the GNU General Public
9182007SrobertoLicense as published by the Free Software Foundation; either
10132451Srobertoversion 3 of the License, or (at your option) any later version.
11182007Sroberto
12182007SrobertoLibgfortran is distributed in the hope that it will be useful,
13182007Srobertobut WITHOUT ANY WARRANTY; without even the implied warranty of
14182007SrobertoMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15182007SrobertoGNU General Public License for more details.
16182007Sroberto
17182007SrobertoUnder Section 7 of GPL version 3, you are granted additional
18182007Srobertopermissions described in the GCC Runtime Library Exception, version
19182007Sroberto3.1, as published by the Free Software Foundation.
20182007Sroberto
21182007SrobertoYou should have received a copy of the GNU General Public License and
22182007Srobertoa copy of the GCC Runtime Library Exception along with this program;
23182007Srobertosee the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
24182007Sroberto<http://www.gnu.org/licenses/>.  */
25182007Sroberto
26182007Sroberto#include "libgfortran.h"'
27182007Sroberto
28182007Srobertoinclude(iparm.m4)dnl
29182007Srobertoinclude(ifunction.m4)dnl
30182007Sroberto
31182007Sroberto`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)'
32182007Sroberto
33182007SrobertoARRAY_FUNCTION(0,
34132451Sroberto`  result = 0;',
35132451Sroberto`  result += *src;')
36132451Sroberto
37132451SrobertoMASKED_ARRAY_FUNCTION(0,
38132451Sroberto`  result = 0;',
39132451Sroberto`  if (*msrc)
40132451Sroberto    result += *src;')
41132451Sroberto
42132451SrobertoSCALAR_ARRAY_FUNCTION(0)
43182007Sroberto
44182007Sroberto#endif
45132451Sroberto