gcc/
[official-gcc.git] / gcc-4_9-branch / gcc / testsuite / gcc.target / ia64 / float80-varargs-1.c
blob96524be6b1f503225f8ac23c8bc5412c19f9b122
1 /* Test for a bug with passing __float80 in varargs. The __float80
2 value was wrongly passed, leading to an abort. */
3 /* Origin: Joseph Myers <joseph@codesourcery.com> */
4 /* { dg-do run } */
5 /* { dg-options "" } */
7 #include <stdarg.h>
9 extern void abort (void);
10 extern void exit (int);
12 __float80 s = 1.234L;
13 __float80 d;
15 void vf (int a0, ...);
17 int
18 main (void)
20 vf (0, s);
21 if (d != s)
22 abort ();
23 exit (0);
26 void
27 vf (int a0, ...)
29 va_list ap;
30 va_start (ap, a0);
31 d = va_arg (ap, __float80);
32 va_end (ap);