aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/floatn-errs.c
blob: 9fb3f90262c79d47a1c5a5af80d9a365d3627684 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* Tests for _FloatN / _FloatNx types: test erroneous code.  */
/* { dg-do compile } */
/* { dg-options "-std=gnu17" } */
/* { dg-add-options float32 } */
/* { dg-add-options float64 } */
/* { dg-add-options float32x } */
/* { dg-require-effective-target float32 } */
/* { dg-require-effective-target float32x } */
/* { dg-require-effective-target float64 } */

/* _FloatN, _FloatNx and standard types are incompatible even if they
   have the same ABI.  */

extern float a; /* { dg-message "previous declaration" } */
extern _Float32 a; /* { dg-error "conflicting" } */

extern double b; /* { dg-message "previous declaration" } */
extern _Float32x b; /* { dg-error "conflicting" } */

extern _Float64 c; /* { dg-message "previous declaration" } */
extern _Float32x c; /* { dg-error "conflicting" } */

/* These types are not promoted in old-style function definitions.  */

void f (_Float32);
void
f (x)
     _Float32 x;
{
}

void g (double); /* { dg-error "prototype declaration" } */
void
g (x)
     _Float32 x; /* { dg-error "match prototype" } */
{
}

void h (_Float64); /* { dg-error "prototype declaration" } */
void
h (x)
     _Float32 x; /* { dg-error "match prototype" } */
{
}