annotate gcc/testsuite/ada/acats/tests/cxb/cxb30130.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /*
kono
parents:
diff changeset
2 -- CXB30130.C
kono
parents:
diff changeset
3 --
kono
parents:
diff changeset
4 -- Grant of Unlimited Rights
kono
parents:
diff changeset
5 --
kono
parents:
diff changeset
6 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
kono
parents:
diff changeset
7 -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
kono
parents:
diff changeset
8 -- unlimited rights in the software and documentation contained herein.
kono
parents:
diff changeset
9 -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
kono
parents:
diff changeset
10 -- this public release, the Government intends to confer upon all
kono
parents:
diff changeset
11 -- recipients unlimited rights equal to those held by the Government.
kono
parents:
diff changeset
12 -- These rights include rights to use, duplicate, release or disclose the
kono
parents:
diff changeset
13 -- released technical data and computer software in whole or in part, in
kono
parents:
diff changeset
14 -- any manner and for any purpose whatsoever, and to have or permit others
kono
parents:
diff changeset
15 -- to do so.
kono
parents:
diff changeset
16 --
kono
parents:
diff changeset
17 -- DISCLAIMER
kono
parents:
diff changeset
18 --
kono
parents:
diff changeset
19 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
kono
parents:
diff changeset
20 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
kono
parents:
diff changeset
21 -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
kono
parents:
diff changeset
22 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
kono
parents:
diff changeset
23 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
kono
parents:
diff changeset
24 -- PARTICULAR PURPOSE OF SAID MATERIAL.
kono
parents:
diff changeset
25 --*
kono
parents:
diff changeset
26 --
kono
parents:
diff changeset
27 -- FUNCTION NAME: CXB30130 ("square_it")
kono
parents:
diff changeset
28 --
kono
parents:
diff changeset
29 -- FUNCTION DESCRIPTION:
kono
parents:
diff changeset
30 -- This C function returns the square of num1 through the function
kono
parents:
diff changeset
31 -- name, and returns the square of parameters num2, num3, and num4
kono
parents:
diff changeset
32 -- through the argument list (modifying the objects pointed to by
kono
parents:
diff changeset
33 -- the parameters).
kono
parents:
diff changeset
34 --
kono
parents:
diff changeset
35 -- INPUTS:
kono
parents:
diff changeset
36 -- This function requires that four parameters be passed to it.
kono
parents:
diff changeset
37 -- The types of these parameters are, in order: int, pointer to short,
kono
parents:
diff changeset
38 -- pointer to float, and pointer to double.
kono
parents:
diff changeset
39 --
kono
parents:
diff changeset
40 -- PROCESSING:
kono
parents:
diff changeset
41 -- The function will calculate the square of the int parameter (num1),
kono
parents:
diff changeset
42 -- and return this value as the function result through the function
kono
parents:
diff changeset
43 -- name. The function will also calculate the square of the values
kono
parents:
diff changeset
44 -- pointed to by the remaining three parameters (num2, num3, num4),
kono
parents:
diff changeset
45 -- and will modify the referenced memory locations to contain the
kono
parents:
diff changeset
46 -- squared values.
kono
parents:
diff changeset
47 --
kono
parents:
diff changeset
48 -- OUTPUTS:
kono
parents:
diff changeset
49 -- The square of num1 is returned through function name.
kono
parents:
diff changeset
50 -- Parameters num2-num4 now point to values that are the squared results
kono
parents:
diff changeset
51 -- of the originally referenced values (i.e., the original values are
kono
parents:
diff changeset
52 -- modified as a result of this function).
kono
parents:
diff changeset
53 --
kono
parents:
diff changeset
54 -- CHANGE HISTORY:
kono
parents:
diff changeset
55 -- 12 Oct 95 SAIC Initial prerelease version.
kono
parents:
diff changeset
56 --
kono
parents:
diff changeset
57 --!
kono
parents:
diff changeset
58 */
kono
parents:
diff changeset
59
kono
parents:
diff changeset
60 int CXB30130 (int num1, short* num2, float* num3, double* num4)
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 /* NOTE: The above function definition should be accepted by an ANSI-C */
kono
parents:
diff changeset
63 /* compiler. Older C compilers may reject it; they may, however */
kono
parents:
diff changeset
64 /* accept the following five lines. An implementation may comment */
kono
parents:
diff changeset
65 /* out the above function definition and uncomment the following */
kono
parents:
diff changeset
66 /* one. Otherwise, an implementation must provide the necessary */
kono
parents:
diff changeset
67 /* modifications to this C code to satisfy the function */
kono
parents:
diff changeset
68 /* requirements (see Function Description). */
kono
parents:
diff changeset
69 /* */
kono
parents:
diff changeset
70 /* int CXB30130 (num1, num2, num3, num4) */
kono
parents:
diff changeset
71 /* int num1; */
kono
parents:
diff changeset
72 /* short* num2; */
kono
parents:
diff changeset
73 /* float* num3; */
kono
parents:
diff changeset
74 /* double* num4; */
kono
parents:
diff changeset
75 /* */
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 {
kono
parents:
diff changeset
78 int return_value = 0;
kono
parents:
diff changeset
79
kono
parents:
diff changeset
80 return_value = num1 * num1;
kono
parents:
diff changeset
81 *num2 = *num2 * *num2; /* Return square of these parameters through */
kono
parents:
diff changeset
82 *num3 = *num3 * *num3; /* the parameter list. */
kono
parents:
diff changeset
83 *num4 = *num4 * *num4;
kono
parents:
diff changeset
84
kono
parents:
diff changeset
85 return (return_value); /* Return square of num1 through function name */
kono
parents:
diff changeset
86 }