diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/builtin-tgmath-err-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/builtin-tgmath-err-2.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/builtin-tgmath-err-2.c b/gcc/testsuite/gcc.dg/builtin-tgmath-err-2.c new file mode 100644 index 00000000000..df5655ef402 --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtin-tgmath-err-2.c @@ -0,0 +1,19 @@ +/* Test __builtin_tgmath: errors that indicate bad arguments in a call + to a type-generic macro, non-DFP. */ +/* { dg-do compile } */ +/* { dg-options "" } */ + +float f_f (float); +double f_d (double); +long double f_ld (long double); +void *p; +long double ld; +_Complex float cf; + +void +test (void) +{ + __builtin_tgmath (f_f, f_d, f_ld, p); /* { dg-error "invalid type of argument" } */ + __builtin_tgmath (f_f, f_d, ld); /* { dg-error "no matching function for type-generic call" } */ + __builtin_tgmath (f_f, f_d, cf); /* { dg-error "no matching function for type-generic call" } */ +} |