| 1 |
/* Tests for _FloatN / _FloatNx types: test erroneous code. */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-std=gnu17" } */ |
| 4 |
/* { dg-add-options float32 } */ |
| 5 |
/* { dg-add-options float64 } */ |
| 6 |
/* { dg-add-options float32x } */ |
| 7 |
/* { dg-require-effective-target float32 } */ |
| 8 |
/* { dg-require-effective-target float32x } */ |
| 9 |
/* { dg-require-effective-target float64 } */ |
| 10 |
|
| 11 |
/* _FloatN, _FloatNx and standard types are incompatible even if they |
| 12 |
have the same ABI. */ |
| 13 |
|
| 14 |
extern float a; /* { dg-message "previous declaration" } */ |
| 15 |
extern _Float32 a; /* { dg-error "conflicting" } */ |
| 16 |
|
| 17 |
extern double b; /* { dg-message "previous declaration" } */ |
| 18 |
extern _Float32x b; /* { dg-error "conflicting" } */ |
| 19 |
|
| 20 |
extern _Float64 c; /* { dg-message "previous declaration" } */ |
| 21 |
extern _Float32x c; /* { dg-error "conflicting" } */ |
| 22 |
|
| 23 |
/* These types are not promoted in old-style function definitions. */ |
| 24 |
|
| 25 |
void f (_Float32); |
| 26 |
void |
| 27 |
f (x) |
| 28 |
_Float32 x; |
| 29 |
{ |
| 30 |
} |
| 31 |
|
| 32 |
void g (double); /* { dg-error "prototype declaration" } */ |
| 33 |
void |
| 34 |
g (x) |
| 35 |
_Float32 x; /* { dg-error "match prototype" } */ |
| 36 |
{ |
| 37 |
} |
| 38 |
|
| 39 |
void h (_Float64); /* { dg-error "prototype declaration" } */ |
| 40 |
void |
| 41 |
h (x) |
| 42 |
_Float32 x; /* { dg-error "match prototype" } */ |
| 43 |
{ |
| 44 |
} |