OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20050121-1.c] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
/* PR middle-end/19551 */
2
 
3
extern void abort ();
4
 
5
#define T(type, name) \
6
__attribute__((pure)) _Complex type             \
7
foo_##name (int x)                              \
8
{                                               \
9
  _Complex type r;                              \
10
  __real r = x + 1;                             \
11
  __imag r = x - 1;                             \
12
  return r;                                     \
13
}                                               \
14
                                                \
15
void                                            \
16
bar_##name (type *x)                            \
17
{                                               \
18
  *x = __real foo_##name (5);                   \
19
}                                               \
20
                                                \
21
void                                            \
22
baz_##name (type *x)                            \
23
{                                               \
24
  *x = __imag foo_##name (5);                   \
25
}
26
 
27
typedef long double ldouble_t;
28
typedef long long llong;
29
 
30
T (float, float)
31
T (double, double)
32
T (long double, ldouble_t)
33
T (char, char)
34
T (short, short)
35
T (int, int)
36
T (long, long)
37
T (long long, llong)
38
#undef T
39
 
40
int
41
main (void)
42
{
43
#define T(type, name) \
44
  {                                             \
45
    type var = 0;                                \
46
    bar_##name (&var);                          \
47
    if (var != 6)                               \
48
      abort ();                                 \
49
    var = 0;                                     \
50
    baz_##name (&var);                          \
51
    if (var != 4)                               \
52
      abort ();                                 \
53
  }
54
  T (float, float)
55
  T (double, double)
56
  T (long double, ldouble_t)
57
  T (char, char)
58
  T (short, short)
59
  T (int, int)
60
  T (long, long)
61
  T (long long, llong)
62
  return 0;
63
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.