blob: 1a895920b85b0da22c0c69cec635363abc93c6b1 [file] [log] [blame]
Diego Novillo6de9cd92004-05-13 02:41:07 -04001`/* Implementation of the SUM intrinsic
Jakub Jelinek99dee822021-01-04 10:26:59 +01002 Copyright (C) 2002-2021 Free Software Foundation, Inc.
Diego Novillo6de9cd92004-05-13 02:41:07 -04003 Contributed by Paul Brook <paul@nowt.org>
4
Toon Moene57dea9f2005-01-12 22:27:33 +01005This file is part of the GNU Fortran 95 runtime library (libgfortran).
Diego Novillo6de9cd92004-05-13 02:41:07 -04006
7Libgfortran is free software; you can redistribute it and/or
Toon Moene57dea9f2005-01-12 22:27:33 +01008modify it under the terms of the GNU General Public
Diego Novillo6de9cd92004-05-13 02:41:07 -04009License as published by the Free Software Foundation; either
Jakub Jelinek748086b2009-04-09 17:00:19 +020010version 3 of the License, or (at your option) any later version.
Diego Novillo6de9cd92004-05-13 02:41:07 -040011
12Libgfortran is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Toon Moene57dea9f2005-01-12 22:27:33 +010015GNU General Public License for more details.
Diego Novillo6de9cd92004-05-13 02:41:07 -040016
Jakub Jelinek748086b2009-04-09 17:00:19 +020017Under Section 7 of GPL version 3, you are granted additional
18permissions described in the GCC Runtime Library Exception, version
193.1, as published by the Free Software Foundation.
20
21You should have received a copy of the GNU General Public License and
22a copy of the GCC Runtime Library Exception along with this program;
23see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24<http://www.gnu.org/licenses/>. */
Diego Novillo6de9cd92004-05-13 02:41:07 -040025
Francois-Xavier Coudert887d9b82016-12-21 10:41:57 +000026#include "libgfortran.h"'
Diego Novillo6de9cd92004-05-13 02:41:07 -040027
28include(iparm.m4)dnl
29include(ifunction.m4)dnl
François-Xavier Coudert644cb692005-10-03 07:22:20 +000030
31`#if defined (HAVE_'atype_name`) && defined (HAVE_'rtype_name`)'
32
Diego Novillo6de9cd92004-05-13 02:41:07 -040033ARRAY_FUNCTION(0,
34` result = 0;',
35` result += *src;')
36
37MASKED_ARRAY_FUNCTION(0,
38` result = 0;',
39` if (*msrc)
40 result += *src;')
François-Xavier Coudert644cb692005-10-03 07:22:20 +000041
Thomas Koenig97a62032006-03-20 21:56:00 +000042SCALAR_ARRAY_FUNCTION(0)
43
François-Xavier Coudert644cb692005-10-03 07:22:20 +000044#endif