1 /* 2 pr15262-2.c from the execute part of the gcc torture tests. 3 */ 4 5 #include <testfwk.h> 6 7 #ifdef __SDCC 8 #pragma std_c99 9 #endif 10 11 /* TODO: Enable this once we can pass structures as function arguments! */ 12 #if 0 13 /* PR 15262. Similar to pr15262-1.c but with no obvious addresses 14 being taken in function foo(). Without IPA, by only looking inside 15 foo() we cannot tell for certain whether 'q' and 'b' alias each 16 other. */ 17 struct A 18 { 19 int t; 20 int i; 21 }; 22 23 struct B 24 { 25 int *p; 26 float b; 27 }; 28 29 float X; 30 31 foo (struct B b, struct A *q, float *h) 32 { 33 X += *h; 34 *(b.p) = 3; 35 q->t = 2; 36 return *(b.p); 37 } 38 #endif 39 40 void testTortureExecute(void)41testTortureExecute (void) 42 { 43 #if 0 44 struct A a; 45 struct B b; 46 47 b.p = &a.t; 48 if (foo (b, &a, &X) == 3) 49 ASSERT (0); 50 51 return; 52 #endif 53 } 54