aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/dfp/pr31344.c
blob: de76a72f9374b1f9a3bcfe38017fab1a337d3472 (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
/* { dg-do compile } */
/* { dg-options "-O -std=gnu99 -mtune=i386" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
/* { dg-options "-O -std=gnu99" } */

typedef struct
{
  unsigned char bits;
} decNumber;

typedef struct
{
  unsigned char bytes[1];
} decimal32;

extern decNumber *__decimal32ToNumber (const decimal32 *, decNumber *);
extern void __host_to_ieee_32 (_Decimal32, decimal32 *);

void
foo (_Decimal32 arg)
{
  decNumber dn;
  decimal32 d32;
  __host_to_ieee_32 (arg, &d32);
  __decimal32ToNumber (&d32, &dn);
}