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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [builtin-types-compatible-p.c] - Blame information for rev 688

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
int i;
2
double d;
3
 
4
/* Make sure we return a constant.  */
5
float rootbeer[__builtin_types_compatible_p (int, typeof(i))];
6
 
7
typedef enum { hot, dog, poo, bear } dingos;
8
typedef enum { janette, laura, amanda } cranberry;
9
 
10
typedef float same1;
11
typedef float same2;
12
 
13
int main (void);
14
 
15
int main (void)
16
{
17
  /* Compatible types.  */
18
  if (!(__builtin_types_compatible_p (int, const int)
19
        && __builtin_types_compatible_p (typeof (hot), int)
20
        && __builtin_types_compatible_p (typeof (hot), typeof (laura))
21
        && __builtin_types_compatible_p (int[5], int[])
22
        && __builtin_types_compatible_p (same1, same2)))
23
    abort ();
24
 
25
  /* Incompatible types.  */
26
  if (__builtin_types_compatible_p (char *, int)
27
      || __builtin_types_compatible_p (char *, const char *)
28
      || __builtin_types_compatible_p (long double, double)
29
      || __builtin_types_compatible_p (typeof (i), typeof (d))
30
      || __builtin_types_compatible_p (typeof (dingos), typeof (cranberry))
31
      || __builtin_types_compatible_p (char, int)
32
      || __builtin_types_compatible_p (char *, char **))
33
    abort ();
34
  exit (0);
35
}

powered by: WebSVN 2.1.0

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