diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/builtin-apply4.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/builtin-apply4.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/builtin-apply4.c b/gcc/testsuite/gcc.dg/builtin-apply4.c new file mode 100644 index 000000000..7a14356e2 --- /dev/null +++ b/gcc/testsuite/gcc.dg/builtin-apply4.c @@ -0,0 +1,31 @@ +/* PR tree-optimization/20076 */ +/* { dg-options "-O2 -Wmissing-noreturn" } */ +/* { dg-options "-O2 -mno-mmx" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */ +/* { dg-do run } */ + +extern void abort (void); + +double +foo (int arg) +{ + if (arg != 116) + abort(); + return arg + 1; +} + +inline double +bar (int arg) +{ + foo (arg); + __builtin_return (__builtin_apply ((void (*) ()) foo, + __builtin_apply_args (), 16)); +} + +int +main (int argc, char **argv) +{ + if (bar (116) != 117.0) + abort (); + + return 0; +} |