1 /*
2    pr68390.c from the execute part of the gcc torture tests.
3  */
4 
5 #include <testfwk.h>
6 
7 #ifdef __SDCC
8 #pragma disable_warning 93
9 #endif
10 
11 /* { dg-do run }  */
12 /* { dg-options "-O2" } */
13 
14 #ifndef __SDCC_pdk14 // Lack of memory
direct(int x,...)15 double direct(int x, ...)
16 {
17   return x*x;
18 }
19 #endif
20 
broken(double (* indirect)(int x,...),int v)21 double broken(double (*indirect)(int x, ...), int v)
22 {
23   return indirect(v);
24 }
25 
26 void
testTortureExecute(void)27 testTortureExecute (void)
28 {
29 #ifndef __SDCC_pdk14 // Lack of memory
30   double d1;
31   int i = 2;
32   d1 = broken (direct, i);
33   ASSERT (d1 == i*i);
34   return;
35 #endif
36 }
37 
38