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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [dfp/] [cast-bad.c] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-std=gnu99" } */
3
 
4
/* C99 6.5.4 Cast operators.
5
   Test invalid casts involving decimal float.  */
6
 
7
struct s { _Decimal32 d32; } sv;
8
union u { _Decimal32 d32; } uv;
9
 
10
_Decimal32 d32;
11
_Decimal64 d64;
12
_Decimal128 d128;
13
 
14
_Decimal32* d32p;
15
_Decimal64* d64p;
16
_Decimal128* d128p;
17
 
18
void
19
f (void)
20
{
21
  (_Decimal32 []) d32p; /* { dg-error "cast specifies array type" } */
22
  (_Decimal32 ()) d32p; /* { dg-error "cast specifies function type" } */
23
  (_Decimal64 []) d64p; /* { dg-error "cast specifies array type" } */
24
  (_Decimal64 ()) d64p; /* { dg-error "cast specifies function type" } */
25
  (_Decimal128 []) d128p; /* { dg-error "cast specifies array type" } */
26
  (_Decimal128 ()) d128p; /* { dg-error "cast specifies function type" } */
27
 
28
  (struct s) d32; /* { dg-error "conversion to non-scalar type requested" } */
29
  (union u) d32;
30
  (struct s) d64; /* { dg-error "conversion to non-scalar type requested" } */
31
  (union u) d64; /* { dg-error "cast to union type from type not present in union" } */
32
  (struct s) d128; /* { dg-error "conversion to non-scalar type requested" } */
33
  (union u) d128; /* { dg-error "cast to union type from type not present in union" } */
34
 
35
  (_Decimal32) sv; /* { dg-error "aggregate value used where a float was expected" } */
36
  (_Decimal32) uv; /* { dg-error "aggregate value used where a float was expected" } */
37
  (_Decimal64) sv; /* { dg-error "aggregate value used where a float was expected" } */
38
  (_Decimal64) uv; /* { dg-error "aggregate value used where a float was expected" } */
39
  (_Decimal128) sv; /* { dg-error "aggregate value used where a float was expected" } */
40
  (_Decimal128) uv; /* { dg-error "aggregate value used where a float was expected" } */
41
}

powered by: WebSVN 2.1.0

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