blob: d43f011d7b11204a5cab07b3288a5b174318eec6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
/*
loop-13.c from the execute part of the gcc torture tests.
*/
#include <testfwk.h>
#ifdef __SDCC
#pragma std_c99
#endif
/* PR opt/7130 */
#define TYPE long
#if !defined(__SDCC_pdk14) // Lack of memory
void
scale (TYPE *alpha, TYPE *x, int n)
{
int i, ix;
if (*alpha != 1)
for (i = 0, ix = 0; i < n; i++, ix += 2)
{
TYPE tmpr, tmpi;
tmpr = *alpha * x[ix];
tmpi = *alpha * x[ix + 1];
x[ix] = tmpr;
x[ix + 1] = tmpi;
}
}
#endif
void
testTortureExecute (void)
{
#if !defined(__SDCC_pdk14) // Lack of memory
int i;
TYPE x[10];
TYPE alpha = 2;
for (i = 0; i < 10; i++)
x[i] = i;
scale (&alpha, x, 5);
if (x[9] != 18)
ASSERT (0);
return;
#endif
}
|