1 /* { dg-do compile } */ 2 /* { dg-options "-O2" } */ 3 4 void g (void); 5 f1(int x)6void f1 (int x) 7 { 8 if (x != (int) g + 3) 9 return; 10 g(); 11 } 12 13 void (*a2)(void); 14 f2(void)15void f2 (void) 16 { 17 a2 = &g + 3; 18 } 19 20 typedef void (*__sighandler_t)(int); 21 void handler (int); 22 f3(int x)23void f3 (int x) 24 { 25 __sighandler_t h = &handler; 26 if (h != (__sighandler_t) 2 && h != (__sighandler_t) 1) 27 h (x); 28 } 29 30 /* { dg-final { scan-assembler-times {add(?:s)?\tr[0-9]+, r[0-9]+, #3} 2 } } */ 31 /* { dg-final { scan-assembler-not {.word\tg\+3} } } */ 32 /* { dg-final { scan-assembler-not {.word\thandler-1} } } */ 33