1 /* 2 20031214-1.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 #pragma disable_warning 85 10 #pragma disable_warning 93 11 #endif 12 13 /* PR optimization/10312 */ 14 /* Originator: Peter van Hoof <p dot van-hoof at qub dot ac dot uk> */ 15 16 /* Verify that the strength reduction pass doesn't find 17 illegitimate givs. */ 18 19 struct 20 { 21 double a; 22 int n[2]; 23 } g = { 0., { 1, 2}}; 24 25 int k = 0; 26 27 void b(int * j)28b (int *j) 29 { 30 } 31 32 void testTortureExecute(void)33testTortureExecute (void) 34 { 35 int j; 36 37 for (j = 0; j < 2; j++) 38 k = (k > g.n[j]) ? k : g.n[j]; 39 40 k++; 41 b (&j); 42 43 return; 44 } 45 46