]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/Wtrampolines.c
1 /* Origin: trampoline-1.c Waldek Hebisch <hebisch@math.uni.wroc.pl> */
2 /* Ported to test -Wtrampolines Magnus Granberg <zorry@gentoo.org> */
4 /* { dg-do compile } */
5 /* { dg-require-effective-target trampolines } */
6 /* { dg-options "-O2 -Wtrampolines" } */
8 /* This used to fail on various versions of Solaris 2 because the
9 trampoline couldn't be made executable. */
11 extern void abort(void);
12 extern double fabs(double);
16 const int correct
[1100] = {1, 0, -2, 0, 1, 0, 1, -1, -10, -30, -67};
19 double x1 (void) {return 1; }
20 double x2 (void) {return -1;}
21 double x3 (void) {return -1;}
22 double x4 (void) {return 1; }
23 double x5 (void) {return 0; }
25 typedef double pfun(void);
27 double a (int k
, pfun x1
, pfun x2
, pfun x3
, pfun x4
, pfun x5
)
29 double b (void) /* { dg-warning "trampoline generated for nested function 'b'" "standard descriptors" { xfail { { ia64-*-* *-*-aix* } || { powerpc*-*-* && lp64 } } } } */
32 return a (k
, b
, x1
, x2
, x3
, x4
);
43 if (fabs(a( i
, x1
, x2
, x3
, x4
, x5
) - correct
[i
]) > 0.1)