| 1 |
// { dg-do compile } |
| 2 |
|
| 3 |
// Check that the compiler mangles types defined with decimal float |
| 4 |
// modes according to the vendor-neutral C++ ABI. |
| 5 |
|
| 6 |
typedef float _Decimal32 __attribute__((mode(SD))); |
| 7 |
typedef float _Decimal64 __attribute__((mode(DD))); |
| 8 |
typedef float _Decimal128 __attribute__((mode(TD))); |
| 9 |
|
| 10 |
extern void foo32 (_Decimal32 a, _Decimal32 &b, _Decimal32 *c); |
| 11 |
extern void foo64 (_Decimal64 *a, _Decimal64 b, _Decimal64 &c); |
| 12 |
extern void foo128 (_Decimal128 &a, _Decimal128 *b, _Decimal128 c); |
| 13 |
|
| 14 |
void |
| 15 |
bar32 (void) |
| 16 |
{ |
| 17 |
_Decimal32 x, y, z; |
| 18 |
foo32 (x, y, &z); |
| 19 |
} |
| 20 |
|
| 21 |
void |
| 22 |
bar64 (void) |
| 23 |
{ |
| 24 |
_Decimal64 x, y, z; |
| 25 |
foo64 (&x, y, z); |
| 26 |
} |
| 27 |
|
| 28 |
void |
| 29 |
bar128 (void) |
| 30 |
{ |
| 31 |
_Decimal128 x, y, z; |
| 32 |
foo128 (x, &y, z); |
| 33 |
} |
| 34 |
|
| 35 |
// { dg-final { scan-assembler "Z5foo32DfRDfPDf" } } |
| 36 |
// { dg-final { scan-assembler "Z5foo64PDdDdRDd" } } |
| 37 |
// { dg-final { scan-assembler "Z6foo128RDePDeDe" } } |