1 /* { dg-do compile } */
6 int x
= __builtin_add_overflow (); /* { dg-error "not enough arguments to function" } */
7 x
+= __builtin_sub_overflow (); /* { dg-error "not enough arguments to function" } */
8 x
+= __builtin_mul_overflow (); /* { dg-error "not enough arguments to function" } */
13 f2 (int a
, int b
, int *c
, int d
)
15 int x
= __builtin_add_overflow (a
, b
, c
, d
); /* { dg-error "too many arguments to function" } */
16 x
+= __builtin_sub_overflow (a
, b
, c
, d
, d
, d
); /* { dg-error "too many arguments to function" } */
17 x
+= __builtin_mul_overflow (a
, b
, c
, d
); /* { dg-error "too many arguments to function" } */
21 enum E
{ e0
= 0, e1
= 1 };
28 f3 (float fa
, int a
, _Complex
long int ca
, double fb
, void *pb
, int b
, enum E eb
, bool bb
, int *c
)
30 int x
= __builtin_add_overflow (fa
, b
, c
); /* { dg-error "argument 1 in call to function\[^\n\r]*does not have integral type" } */
31 x
+= __builtin_sub_overflow (ca
, b
, c
); /* { dg-error "argument 1 in call to function\[^\n\r]*does not have integral type" } */
32 x
+= __builtin_mul_overflow (a
, fb
, c
); /* { dg-error "argument 2 in call to function\[^\n\r]*does not have integral type" } */
33 x
+= __builtin_add_overflow (a
, pb
, c
); /* { dg-error "argument 2 in call to function\[^\n\r]*does not have integral type" } */
34 x
+= __builtin_sub_overflow (a
, eb
, c
);
35 x
+= __builtin_mul_overflow (a
, bb
, c
);
40 f4 (float *fp
, double *dp
, _Complex
int *cp
, enum E
*ep
, bool *bp
, long long int *llp
)
42 int x
= __builtin_add_overflow (1, 2, fp
); /* { dg-error "argument 3 in call to function\[^\n\r]*does not have pointer to integer type" } */
43 x
+= __builtin_sub_overflow (1, 2, dp
); /* { dg-error "argument 3 in call to function\[^\n\r]*does not have pointer to integer type" } */
44 x
+= __builtin_mul_overflow (1, 2, cp
); /* { dg-error "argument 3 in call to function\[^\n\r]*does not have pointer to integer type" } */
45 x
+= __builtin_add_overflow (1, 2, ep
); /* { dg-error "argument 3 in call to function\[^\n\r]*does not have pointer to integer type" } */
46 x
+= __builtin_sub_overflow (1, 2, bp
); /* { dg-error "argument 3 in call to function\[^\n\r]*does not have pointer to integer type" } */
47 x
+= __builtin_mul_overflow (1, 2, llp
);