Use gather loads for strided accesses
[official-gcc.git] / gcc / testsuite / gcc.target / rl78 / test_addm3.c
blob1beeb1b0ac8e62e74223f94e85d6cb59137e24a4
1 /* Remove `-ansi' from options to enable the use of __far and long long. */
2 /* { dg-options "" } */
4 #define ADD(TYPE, name) \
5 TYPE \
6 add##name(TYPE a, TYPE b) \
7 { \
8 return a + b; \
9 } \
11 #define ADDIMM(TYPE, name) \
12 TYPE \
13 addimm##name(TYPE a) \
14 { \
15 return a + 50; \
16 } \
18 #define ADDFAR(TYPE, name) \
19 TYPE __far gf##name; \
20 void \
21 addfar##name(TYPE __far *pa, TYPE b) \
22 { \
23 gf##name += b; \
24 *pa += 50; \
25 } \
28 ADD (char, qi3)
29 ADD (int, hi3)
30 ADD (long, si3)
31 ADD (long long, di3)
32 ADD (float, sf3)
33 ADD (double, df3)
35 ADDIMM (char, qi3)
36 ADDIMM (int, hi3)
37 ADDIMM (long, si3)
38 ADDIMM (long long, di3)
39 ADDIMM (float, sf3)
40 ADDIMM (double, df3)
42 ADDFAR (char, qi3)
43 ADDFAR (int, hi3)
44 ADDFAR (long, si3)
45 ADDFAR (long long, di3)
46 ADDFAR (float, sf3)
47 ADDFAR (double, df3)
49 char aqi1, aqi2;
50 int ahi1, ahi2;
51 long asi1, asi2;
52 long long adi1, adi2;
53 float af1, af2;
54 double ad1, ad2;
56 void
57 testglobal (void)
59 aqi1 += aqi2;
60 ahi1 += ahi2;
61 asi1 += asi2;
62 adi1 += adi2;
63 af1 += af2;
64 ad1 += ad2;
67 void
68 testglobal2 (void)
70 aqi1 += 10;
71 ahi1 += 11;
72 asi1 += 12;
73 adi1 += 13;
74 af1 += 2.0;
75 ad1 += 4.0;
78 void
79 testptr (char *aqi1, int *ahi1, long *asi1, long long *adi1, float *af1, double *ad1,
80 char *aqi2, int *ahi2, long *asi2, long long *adi2, float *af2, double *ad2)
82 *aqi1 += *aqi2;
83 *ahi1 += *ahi2;
84 *asi1 += *asi2;
85 *adi1 += *adi2;
86 *af1 += *af2;
87 *ad1 += *ad2;
90 void
91 testptr2 (char *aqi1, int *ahi1, long *asi1, long long *adi1, float *af1, double *ad1)
93 *aqi1 += 5;
94 *ahi1 += 10;
95 *asi1 += 11;
96 *adi1 += 12;
97 *af1 += 4.5;
98 *ad1 += 5.5;